Setting I2C address for EEPROM: when do you use a pull-up resistor?

Hi

I'm a little confused by the instructions in the datasheet for the AT24C512B so looking to get clarification. On the DIP package pins A0, A1 & A2 define the lowest 3 bits of the I2C address. From examples I've seen on youtube for this, the pins are put directly to 5v or GND (exactly as it says in the initial explanation in the relevant section from the Atmel datasheet below:

DEVICE/PAGE ADDRESSES (A2, A1, A0): The A2, A1, and A0 pins are device address inputs
that are hardwired (directly to GND or to Vcc) for compatibility with other AT24Cxx devices.
When the pins are hardwired, as many as eight 512K devices may be addressed on a single bus
system. (Device addressing is discussed in detail under “Device Addressing,” page 8.) A device
is selected when a corresponding hardware and software match is true. If these pins are left
floating, the A2, A1, and A0 pins will be internally pulled down to GND. However, due to capacitive
coupling that may appear during customer applications, Atmel® recommends always
connecting the address pins to a known state. When using a pull-up resistor, Atmel recommends
using 10k? or less.

So the way I interpret that is I don't need to put a resistor between the pin and GND to define a 0, as they take care of that inside the chip. I don't understand the last sentence however - under what circumstances would I need the resistor?

Thanks for your advice,
Geoff

All I can think of is that an application may want to use resistors for a default address that is changed at some point by other logic.


Rob

Internally the pins have a pull-down resistor, buts it a high-value resistor so nearby signals could couple to the pins and cause them to switch (the internal pull-downs are high value to allow external pull-ups).

Its saying if the chip is near sources of interference to not leave the pins unconnected but to connect to GND or Vdd (via a resistance between 0 and 10K). It'll probably function OK if only ground-plane is near the pins in question, but they seem shy of guaranteeing this.

MarkT:
Its saying if the chip is near sources of interference to not leave the pins unconnected but to connect to GND or Vdd (via a resistance between 0 and 10K). It'll probably function OK if only ground-plane is near the pins in question, but they seem shy of guaranteeing this.

Thanks MarkT,

I had to look up Vdd, so I'm hoping you used it intentionally :slight_smile:

From what you've both typed, if the value supplied to these address pins isn't going to be changed it can be connected Vcc or GND without any resistor, but if they're going to be switched, there should be a resistor to the voltage up or down (depending) to ensure when the transistor isn't activated that there's still a known value there.

Thanks for your explanations - I think I'm back on track now, and as my addresses will be hard wired in I can do without the additional bits.

Thanks !
Geoff

but if they're going to be switched, there should be a resistor to the voltage up or down (depending)

That's about right but probably not strictly necessary if there's no I2C activity before the pins are set and certainly not if they do in fact have internal pullup/downs. That said floating inputs are never a good thing.

But if for some obscure reason you need a value different to the internal setup AND you also need to change that address at run time AND you need to have I2C traffic before you set the address (bit of a long bow here I think) then external resistors would be needed.

Bottom line, unless you are doing something out of the box I'd say you don't need resistors.


Rob

strykeroz:
I don't understand the last sentence however - under what circumstances would I need the resistor?

You would use a resistor for pull-up (as opposed to hardwired to Vcc) in order to reduce quiescent current draw (10k max).

The quiescent current draw is set by the built-in pull-down resistors, unfortunately, since the pull-ups have to win to work, the pull-downs are the one's setting the current.

Its traditional from the old days of NMOS logic (I think) to call supply rails Vss and Vdd (for "source" and "drain" respectively), and this convention stuck when CMOS came in (despite both rails connecting to FET sources).

Partly this helped distinquish CMOS power from TTL power (GND and Vcc) in the days when CMOS logic chips were run off higher voltages. Also those chips (4000 series) could run from 3V to 15V IIRC, so it wasn't right to call the power rail "+5V"

Some people just use Vcc to mean "positive rail", as in TTL whether or not the chip is bipolar. (c for "collector")

Its pretty common for CMOS chip datasheets to use Vss (or GND) and Vdd, for instance I just looked at the MCP3208 datasheet and it uses DGND, AGND and Vdd in the pinout, but Vdd and Vss in the functional block diagram, so they are not even consistent about Vss.

The external pull-up act together with the internal pull-down as a voltage divider between Vcc and Gnd with the Ax input gate at center. As we increase the value of the pull-up resistor, voltage at the Ax input gate drops until eventually the pull down resistor wins. Along the way we reduce current draw from Vcc (pull-up rail) and the safe range according to the datasheet is 10k or less for the external pull-up resistor.

Thanks for the very thorough discussion guys. Based on this, if the power source is the regulated 5V from an Arduino is it just best practice to run with 10kR between the Ax pin and the Vcc to minimise power consumption?

For a single address pin, power savings will be significant as a percentage, but modest in absolute terms. If the internal pull-down is 30k, reduced current with Ax direct to Vcc (assuming 5V) vs. adding a 10k pull-up resistor is about 42 micro amps.