External pull-up resistors for I2C

Hi,

I am using a I2C device with ATmega328p in a customized board. No external pull-up resistors are being used, as expected for Atmega and a single I2C device. The project is working pretty well with a very low power consumption.

Now, I need to add a second I2C device. I had already tested it removing the other I2C device from the bus and the new one also worked fine. I did not try, but I am wondering if we really need to add external pull-up resistors at the SDA and SCL lines due to the fact that we have now two I2C devices. If the answer is a mandatory positive, this restriction creates an impact to my project and the power consumption during sleep mode will increase by more than 2 orders of magnitude (assuming the use of 10K resistors).

I would like to know if somebody has a hint about using a high-value pull-up resistor in this scenario, such as 1M or 3M, or, even better, not using them at all (only the internal).

Thanks!!

I am wondering if we really need to add external pull-up resistors at SDA and SCL lines due to the fact that I will have two I2C devices

It very much depends upon the target speed of operation of your I2C bus, the capacitance of the devices you are attaching, how well they tolerate slow rising edges, etc. In general I'm pretty agressive and put 1.5k resistors on I2C lines because I don't want to deal with intermittent bit errors.

the power consumption during sleep mode will increase by more than 2 orders of magnitude if I use 10K resistors.

I'm not sure I understand your reasoning here. Why does power consumption increase at all in sleep mode? Those resistors only conduct current when the outputs are low. In sleep mode when they are inputs there should be no current at all.

-- The Arduino Drum Machine: MIDI development system with 14-track MIDI drum machine sequencer / groove-box software

Hi RuggedCircuits,

I observed that, at sleeping mode, even putting the I2C interface down, there is a very small current leakage through the external pull-up resistors if they are used. This current is negligible for the majority of the applications (tenths of mA), but not for mine.

If I use Mega ohms resistors, this leakage would be smaller than 1microamp and it would be fine for me.

The I2C devices are ISL12057 (RTC) and TMP102 (temperature sensor).

Thanks

I observed that, at sleeping mode, even putting the I2C interface down, there is a very small current leakage through the external pull-up resistors if they are used. This current is negligible for the majority of the applications (tenths of mA), but not for mine.

Hmmm…very strange. Have you tried playing with the DIDR0 register, specifically disabling the analog input pins that correspond to the I2C?

I doubt 1M resistors would work well with I2C :frowning:


The Aussie Shield: breakout all 28 pins to quick-connect terminals

Yes, the relevant part of the code is attached. Actually, the main leakage is through the I2C devices and the pull-up resistors. With a single device and internal pull-up resistors, the attached code is successful to avoid the leakage from the I2C device.

ACSR = ACSR & 0b11110111 ; ACSR = ACSR | B10000000 ; ADCSRA = ADCSRA & B01111111 ; ADMUX &= B00111111;

cbi(ADCSRA,ADEN); power_adc_disable(); power_spi_disable(); power_twi_disable(); power_usart0_disable(); power_timer0_disable(); power_timer1_disable(); power_timer2_disable();

sleep_mode();

I doubt 1M resistors would work well with I2C

And I know that 1M resistors would do snuff all for I2C.

but I am wondering if we really need to add external pull-up resistors at the SDA and SCL lines

Just look at the signals on these lines on an oscilloscope with and without proper pull up resistors (that's not 1M) and you will understand just how stupid that question is.

and you will understand just how stupid that question is.

That was just mean - IMO

If you are powering down the I2C devices during sleep mode you need to also power down the pull-ups at the same time somehow - depends on the way they are powered down.

Related to the comment, my question is actually how the INTERNAL pull-up resistors can satisfy the requirements for the bus pull-up. There is no doubt that we need the pull-up, but the internal ATmega resistors are doing well the job for one device. However, if we add a second device, what actually occurs?

Does anybody know the answer?

Thanks

And I know that 1M resistors would do snuff all for I2C.

Quote but I am wondering if we really need to add external pull-up resistors at the SDA and SCL lines

Just look at the signals on these lines on an oscilloscope with and without proper pull up resistors (that's not 1M) and you will understand just how stupid that question is.

the internal ATmega resistors are doing well the job for one device

No they are not.

Look at the signals on a scope. It is well out of spec and it just works with a following wind and by the grace of God. It is in no way a proper design even for one device.

This is what your signals look like with and without proper pull up resistors. http://www.dsscircuits.com/articles/effects-of-varying-i2c-pull-up-resistors.html

What are the distances and the wiring configuration? Do you depend on an interrupt to wake?

Are you so short of pins that you cannot connect two inputs in parallel to utilize 2 internal pullups?
Turn the pullups off before it goes to sleep. if two inputs changes the impedance of the line too much, slow down. it does not sound like you are in a hurry.

Power the slave devices from output pins and shut them off when it goes to sleep

If you really need some harder pullups, connect an x Kohm resistor to an output pin and turn it off when not needed. Use the same pin that powers up the clock and TMP

jc

Thanks for the suggestions. I really did not inspect the bus using the scope and the referenced web site ives a good clue about "future" problems in my design.

Answering posted questions: yes, I am using all the pins of the MCU, with the exception of the AREF!! Also, the MCU wakes up with an external device interrupting at INT0. All the I2C devices will be placed at the same PCB.

I solved the problem using an additional SSR device to "switch on/off" the pull-up devices of the bus. More hardware, more complexity, more cost, but still a pretty ultra-low power consumption.

Thanks, Ionito