by jpm_sd · 5y ago · 0 comments
Breakout boards are meant for a quick test. Then you're supposed to design a PCB with the devices you need all in one place. SparkFun spaghetti will only end in tears.
The other thing that sucks about I2C is that you never know what hard-coded addresses you will be limited to, until you've selected all your parts, dug into the datasheets and then discovered the inevitable collisions.
In 20 years of PCB design I think the largest number of I2C devices I've had on one bus is maybe 30? And that was pushing it.
SPI is so much more reliable with just two extra pins, I usually don't even consider I2C anymore.
Slave devices that rely on clock stretching are a total pain in the ass, as well. Tend not to play nice with other normal devices. https://www.i2c-bus.org/clock-stretching/
The main thing I use I2C for in recent designs is multiple channels of power monitoring, e.g. using the INA226. I agree that SPI is preferable for sensors that support it.
I mean I guess we could use an i2c GPIO expander to get extra lines. I bet that would be "fun" to get right.
SPI is usually very stable. Here it's being used to generate VGA signals: https://www.artekit.eu/vga-output-using-a-36-pin-stm32/
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-mult...
You could of course design your own multiplexer with more bytes of multiplexer address space and extend the concept indefinitely. I wouldn't recommend it, but it's possible.