pini.grigio
Posts: 4
Joined: Sun Dec 03, 2023 10:34 pm

Boot issue in multi-board setup with I2C

Sun Dec 03, 2023 10:57 pm

Hi
I have a setup in which Im trying to interconnect several custom RP2040 boards.
Each board has an RP2040 and a sensor on the I2C0 bus, both lines are pulled up with 2k resistors, and each board is powered with its own 3.3V power supply.

My idea was to be able to run each board individually, but also in an array, where one board is the master and communicates with the sensors on each boards I2C bus, while their MCUs sleep.
Im connecting each board through the SDA, SCL and GND lines, but as I mentioned they are running from separate 3.3V supplies.

I didn't take into account the fact that I'd be putting all their pull-up resistances in series, making the pull up too strong, but I was able to get my setup going with only two boards connected like this - I figured a parallel resistance of 1k should be fine.

The issue Im encountering now has to do with the boot process - in my array board, the master setup turns on first, and then turns on the power rail feeding the slave modules - so they turn on after the main board has already been going for about 2-3 seconds.

What Im seeing is the following:
When I power both boards simultaneously - they boot fine.
When I power one board, and then the second board.- the second board goes to BOOTSEL. From there, if I do a software reboot with pico tool - it boots fine.


I realize this isn't a good design for daisy chaining boards, but I'd like to try and salvage the boards I already made and get them playing nice together.
I tried putting the master board to sleep and then powering up the second board - same issue, which leads me to believe this has more to do with the power bootstrap or the weird pull up situation I have (parallel 3.3V rails to common ground)
Is there any way to tell at which point boot fails, or perhaps delay it somehow? Somehow get it to reboot after failing the first time?

Thanks!

arg001
Posts: 615
Joined: Tue Jan 23, 2018 10:06 am

Re: Boot issue in multi-board setup with I2C

Mon Dec 04, 2023 8:36 am

Probably your problem is that the pullups on the I2C are providing power to the "unpowered" units after the first one has powered on, and they therefore start to boot.

The proper solution must be to avoid doing that, but I fixed a similar situation (where the back-powering only occurred with debug equipment attached but was still annoying enough to fix) by providing a delayed reset to the RUN pin.

One way to avoid it in your situation, if you have a spare GPIO, is to connect the pullups to that GPIO (rather than 3V3) and only take it high when all of the units are powered.

If you actually want to use the I2C while some of the RP2040s are connected to it, you can't do that. You could potentially isolate them from the bus with the type of circuit normally used for level-shifting (here, one of your 'levels' is sometimes zero!) .

pini.grigio
Posts: 4
Joined: Sun Dec 03, 2023 10:34 pm

Re: Boot issue in multi-board setup with I2C

Mon Dec 04, 2023 12:21 pm

That makes a lot sense, thanks! I didn't really consider that I'm essentially connecting my 3.3V bus on the unpowered board through the 2 sets of pull-ups in series.

I guess this makes any software solution non-viable.

I was able to control the IC on the second boards i2c bus, even with the RP2040 running, just as long as I powered them up at the same time.

I thought about connecting the 3.3V rails between each board together so they'll all be initially powered from the master boards supply, but Im not sure what having a positive voltage on the outputs of the other boards switching converters might do.

So I think my solution will be to bodge together some adapter boards with level shifters (TXS0102 or maybe a TCA4311A) to put between each pair of boards.

Thanks again!

arg001
Posts: 615
Joined: Tue Jan 23, 2018 10:06 am

Re: Boot issue in multi-board setup with I2C

Mon Dec 04, 2023 10:23 pm

If you just need to be able to sequence the power-up, and don't need to use the I2C bus until they are all 'up', you should be able to fix this by making the master unit drive the I2C pins to zero (ie. configure them initially as GPIO outputs and set them to zero). That should override the I2C pullups and let you power up the slave units, after which the master can configure the pins back to I2C and continue.

pini.grigio
Posts: 4
Joined: Sun Dec 03, 2023 10:34 pm

Re: Boot issue in multi-board setup with I2C

Tue Dec 05, 2023 11:54 am

Wow, didn't think of that either, that should work at least for the two board setup until I can hack together adapter boards.
Thanks again for the fantastic advice 🙏🙏

Just as a theoretical exercise regarding this topology, and apologies if I'm missing some of the basics - but assuming I'd like to daisy chain more boards in this setup - whats the expected limit before the parallel pull-ups make it impossible to drive the bus?

Firstly, I'm not sure how to compute the parallel resistance here, since each pull up connects to a different node (albeit the same voltage).
When I measured the resistance between SDA/SCL to each 3.3V rail - I got 1.5k ohm and not 1k as it would have been if the 3.3V nodes were connected.

Second - imagine I have 4 boards connected and my effective pull-up strength is 2k /4 = 500 ohms, I don't know about the slave, but the RP2040 at least should be capable of sinking 6.6mA to drive the bus, right?
Im assuming this would have some effect on the maximum bus speed?

Once again - thanks for the help, troubleshooting this has taught me a lot about i2c and electronics in general

arg001
Posts: 615
Joined: Tue Jan 23, 2018 10:06 am

Re: Boot issue in multi-board setup with I2C

Tue Dec 05, 2023 2:08 pm

pini.grigio wrote:
Tue Dec 05, 2023 11:54 am
Just as a theoretical exercise regarding this topology, and apologies if I'm missing some of the basics - but assuming I'd like to daisy chain more boards in this setup - whats the expected limit before the parallel pull-ups make it impossible to drive the bus?
There isn't really a hard limit, and it will depend on the individual devices. If they are all RP2040, and you configure the pins for max drive strength, then in theory you should still be able to meet Vil at 12mA current, so 275R pull-up, but I wouldn't recommend it as the noise margin will be compromised - and on a large multi-board setup you want all the margin you can get.
Firstly, I'm not sure how to compute the parallel resistance here, since each pull up connects to a different node (albeit the same voltage).
When I measured the resistance between SDA/SCL to each 3.3V rail - I got 1.5k ohm and not 1k as it would have been if the 3.3V nodes were connected.
In the powered-up circuit, they will behave as if they are simply in parallel. You won't get a sensible reading with an ohm-meter as if you do it powered-up then the voltage on the components will confuse the meter, and if you do it powered down then the assumption that the 3V3 supplies are regulated to the same voltage doesn't hold.

So your 1K calculation was correct.
Second - imagine I have 4 boards connected and my effective pull-up strength is 2k /4 = 500 ohms, I don't know about the slave, but the RP2040 at least should be capable of sinking 6.6mA to drive the bus, right?
Im assuming this would have some effect on the maximum bus speed?
It will actually make the bus speed faster, as it's normally limited by the speed of the rising edges, and your ultra-vigourous pullups will make that better; the RP2040 will still be capable of giving fast falling edges. The downside is noise margin - those zero levels will no longer be so close to zero due to the output impedance of the RP2040's pin drives and also things like resistance in your cables/connectors. And with a multi-board setup this is already marginal.

Really, the best advice is not to use I2C for anything other than short local buses. I2C as a board interconnect seemed like a good idea back in the 1970's (but we didn't need to pass EMC testing back then); nowadays it's seldom a good idea.

pini.grigio
Posts: 4
Joined: Sun Dec 03, 2023 10:34 pm

Re: Boot issue in multi-board setup with I2C

Tue Dec 05, 2023 7:54 pm

Makes sense. Thank you!

Bill52
Posts: 9
Joined: Fri Dec 08, 2023 12:49 pm

Re: Boot issue in multi-board setup with I2C

Fri Dec 08, 2023 5:00 pm

How far are the modules? The I2C documentation recommends 470 pF wire capacitance. Not much, about 10 cm or so. Depending whats implemented.
Further distances can be achieved by line-buffers or 'I2C extenders'. Distance: 50-100 meters depending on the part and the cable used. They would use 5 even 12 V.
NXP makes them. They also offer a necessary bidirectional voltage converter.

Return to “Other RP2040 boards”