Hacker News new | ask | show | jobs
by TaylorAlexander 729 days ago
Thanks for this! I recently designed a sensor board that connects to our main board with I2C, and in chatting with an EE about it she mentioned I2C is not intended for intra-board use. I just put a scope on the signals yesterday and they seem okay. The cable is only 15cm long, and it connects to a multi-use port which would be difficult to make work with differential signals in addition to the other things that port can do. I’ll keep an eye on it but maybe it’s okay.
2 comments

I2C doesn't really care about cable length all that much. The thing to keep in mind is the interplay between bus capacitance, pullup strength, and drive strength.

A longer cable means more bus capacitance, which means with the same pullup resistor the signal rise time will be higher, which means you need to reduce the bus speed. A stronger pullup will reduce the rise time (allowing a higher bus speed), but each chip's driver has to be able to overpower the pullup too. If the pullup is too strong for the drivers, you end up being unable to send a zero.

In practice your cables can be quite long, you just have to run it at a lower speed. If you really want to push it, there's always transceivers like the PCA9615 which turn it into a differential bus.

If you _must_ use I2C, then look at SMBUS if its an option for the parts. I2C's biggest failing is that there is no protocol level timeout, so one stuck device can block your entire bus unless you have a reset line for all the peripherals on it. https://www.analog.com/en/resources/design-notes/guide-to-co...
Classic I2C problem. After your CPU resets, at least clock out a bunch of cycles onto I2C to get interrupted I2C transactions to finish.
Ooh this is great to know thank you!