Wednesday, 8 August 2018

pullup - I2C Pull-ups with Multiple Power Supplies


If I have an I2C Master with multiple I2C Slaves all on separate 3V3 lines (i.e. 3v3_Master, 3V3_Slave1, 3V3_Slave2... etc.) does it matter which 3V3 line the pull-up resistors on the line connect to?


I've looked through the I2C Manual here but couldn't find the answer.



Answer



No it doesn't matter. It will work as long as the micro and pullups both have power. It makes no difference where the voltage comes from - both sides will see 3.3V when no device is pulling down the lines.


With multiple rails, the order that your power rails come up at power-on can sometimes be troublesome. But the good news is that according to the I2C specification, I2C devices and masters are required to use true open-drain outputs, so they won't be damaged or affect communications when they have no power. For example, there are 3 possible states of the micro+pull-up power rails at any given moment for your circuit:



  1. Micro has power, pullups do not: Obviously this means your micro will not be able to communicate with any slaves.

  2. Micro does not have power, pullups do: Your micro should not only NOT be damaged by this state, but it should also NOT pull down on the lines, so potentially another master could communicate on the bus.

  3. Micro and pullups both have power: obviously this means the micro can communicate with any slave that has power, but the I2C spec states that non-powered I2C slaves should not affect the bus.



(All of this assumes I2C compliance, which is not always complete, so as always, testing will tell you for sure.)


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...