1
\$\begingroup\$

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!

\$\endgroup\$
  • \$\begingroup\$ Your description is very confusing. Can you clarify what order of power up makes for a good working system? I know why you're having problems but I'm not clear what power up sequence you desire. \$\endgroup\$ – Vince Patron Jul 19 '16 at 5:02
  • \$\begingroup\$ I need board 1 (slave) to be powered up and ready. When board 2 powers up it sends an i2c message (master), which I'm hoping board 1 will respond to(I have programmed the slave address in this). So board 1 powers up and then board 2. \$\endgroup\$ – fastforward Jul 19 '16 at 5:07
  • 1
    \$\begingroup\$ Board 2's action, as described, really doesn't make sense. The only difference, per your testing seems to be the additional 3K9 of pull-up, in parallel with the 1K. I assume these are both pulled up to 3.3v. Have you tried without the 3K9 pull-ups? What exactly is board 2? Without more info, I don't think anyone can help you. Have you consulted with the board's manufacturer? \$\endgroup\$ – DoxyLover Jul 19 '16 at 5:35
3
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ I managed to power on both boards simultaneously by connecting them to a regulated supply. I had to modify the driver on my board to get the communication going. Seems like board 2 needs the bus to be idle to boot up. It won't boot if it senses a different voltage on SDA, SCL. \$\endgroup\$ – fastforward Jul 20 '16 at 1:13
  • \$\begingroup\$ @fastforward - "Seems like board 2 needs the bus to be idle to boot up." Waiting for an idle bus is not uncommon for master I2C firmware (perhaps the unknown firmware running on board 2 does not have a timeout for how long it waits?). Since you explained that your device (board 1) is configured as a slave, it should not drive SCL or SDA low, until addressed by the master (board 2). \$\endgroup\$ – SamGibson Jul 20 '16 at 2:19

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.