5
\$\begingroup\$

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.

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

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.)

\$\endgroup\$
4
  • 4
    \$\begingroup\$ I'd suggest powering the pull-ups from the master's Vcc. This way, if the slave happens not to be powered, the lines are still pulled-up. This way, trying to address the slave will give the master a NACK, as opposed to the bus not working at all. \$\endgroup\$
    – DoxyLover
    Nov 23, 2013 at 23:20
  • \$\begingroup\$ Agreed. Absolutely. \$\endgroup\$ Nov 24, 2013 at 1:00
  • 2
    \$\begingroup\$ You should take some care to make sure that the slave doesn't draw power from the I2C lines. Internal protection diodes into the power rail can end up causing unpredictable behaviour, with the slave operating outside it's normal regions of operation. If you expect to have slaves turned off, make sure they won't mind a powered I2C bus. \$\endgroup\$ Mar 11, 2014 at 21:14
  • \$\begingroup\$ It depends what type of protection diode you are talking about. A reverse-biased standard diode to the internal Vcc rail (which is common in non-I2C pins on microcontrollers) would violate the I2C-compliance of the part, and would generally not be found on any I2C slaves ('generally' i.e. do your own testing to be sure). On the other hard, a zener to ground would not affect the bus regardless of the state of the slave rails. \$\endgroup\$ Aug 4, 2014 at 3:12
0
\$\begingroup\$

In my opinion, it does matter. The concerns mentioned by other commenters as well do lead to system integration issues, with possible nasty, stochastic bugs.

Nathan is correct that by I2C specification the open drain drivers do not have protection diodes, which may result to the pull-ups powering a 3.3V rail if that rail is not up by the time the rail driving the pull-ups is already up. This may result to occasional brown-out conditions, and a slave or master booting incorrectly.

Typical I2C SDA/SCL I/O pin

If the system has removable components, such as sensors connected via external connectors, ESD mitigation may require the use of TVS diodes. If zener diodes are used above rated above the rail voltage, this is not an issue. If reverse biased diodes are used, then the pull-ups need to be on the rail that comes up last. This is typically a good strategy, given:

  • the host / master does not address slaves before the pull-ups are active (typically not an issue with devices running code).
  • fixed configuration of the bus, with no removable slaves.

With a variable configuration (removable slaves), if the pull-ups are on the slaves, multiple sets of pull-ups may lead to unpredictable conditions. In this case, the pull-ups may be powered from the master's side, and each slave can use a re-driver, or level translator, such as https://www.nxp.com/docs/en/data-sheet/PCA9509P.pdf, with one supply coming from the master side rail, one from the slave. This is probably the safest solution, especially if there is significant difference between the rise times of the rails.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.