Electronic – I2C SCL ground issue

i2c

I'm working on interfacing 2 development boards. I have control over the 1st development board. The 2nd development board is from a third party vendor.
My board (board 1) has a pull up of 3.9K and the third party vendor's board (2nd board) has a pullup of 1K.

The issue I'm facing, is that when both these boards are powered up separately, they boot up and behave correctly but board 2 doesn't boot when the bus is connected. I have access to a I2C protocol analyzer. Both board 1 and board 2 have accompanying daughter boards. With board x <=> daughter x , the I2C messages and voltage levels are fine.

When I tried to connect board 1 <=> board 2, board 2 doesn't boot. I have made sure that slave clocking is disabled on board 1. The requirement is that board 1 needs to be slave, and board 2 needs to be master.

What I have tried so far :
With the I2C unplugged, I powered on board 1 and checked the SDA, SCL levels. They are at 3.3V. As soon as I plug the I2C connector to board 2 (it's still powered off), SCL and SDA get pulled low.

Now I powered on board 2 using the same power supply to ensure common ground. The SDA line goes high immediately, but SCL remains low and there is no activity. Board 2 doesn't boot at all.

I have to stick to this order of power up, since the board 2 sends an I2C message only once a few seconds after power up (confirmed this using board 2 <=> daughter 2 with protocol analyzer).

I'm not sure how to proceed here.

Any help is much appreciated. Thank you!

Best Answer

Problem:

I powered on board 1 [...] As soon as I plug the I2C connector to board 2 (it's still powered off), SCL and SDA get pulled low.

This is completely expected behaviour. You cannot connect both powered and unpowered devices to the same I2C bus, without additional precautions (or unless this is explicitly stated as being supported by that I2C device). In your case, board 2 may also misbehave afterwards as you are likely to be exceeding the maximum allowed voltage connected to an unpowered MCU pin on board 2.

That is because you are effectively trying to power the MCU on (unpowered) board 2 via its I2C bus pins, which are receiving power through the pull-up resistors on (powered) board 1.

Solution:

Use one of the various existing methods of I2C bus isolation between board 1 and board 2.

Since you say that your setup allows you to connect the Gnd between the two boards, I don't see a requirement for the more expensive and complex galvanic isolation methods.

Instead the simple MOSFET-based circuit, often used as an I2C bus level-shifter from the old Philips (now NXP) AppNote AN97055 can be used. Using the simple circuit in section 2.3 of the datasheet, you connect board 2 to the VDD1 side of the circuit:


Figure 2 from Philips AppNote AN97055


[Although not shown on the above circuit diagram, Gnd (0 V) must also be connected between the VDD1 and VDD2 sides.]

Using the above circuit, when the VDD1 (board 2) side is unpowered, it also receives no power via the I2C bus signals, even when the other VDD2 (board 1) side of the circuit is powered. Therefore it stops the problem explained above, as described in this excerpt from the Philips AppNote:


Section 2.3.4 from Philips AppNote AN97055
Various vendors sell I2C level-shifter PCBs with this simple circuit using suitable MOSFETs, if you don't have them yourself. However, note that such PCBs often have pull-up resistors fitted. Since you already have pull-ups installed, you must remove any duplicate pull-up resistors from wherever is easiest (probably by removing them from the additional PCB).