4x identical I2C busses
Circuitsoft
Posts: 1,166
In my upcoming project, I need to simultaneously read data from 8 LIS3DH accelerometers spread across 4 identical I2C busses. I'm wondering if I can connect all the SCK lines together, and have a single driver read all 8 chips. Does anyone have any ready code to do that?
Comments
Since the LIS3DH can run at 400kHz it makes sense to modify a PASM driver to handle 4/8 channels and this shouldn't be too difficult to do yourself perhaps. You probably need to bypass the LIS3DH's FIFO to prevent skewing. At full I2C bus speed you only have 2.5us between clocks so the channels could be read and written between hub and cog during START/STOP. Of course you could go much slower if you are not in a hurry and access the I2C directly from Spin. Is there a minimum update rate your system requires?
I see that the LIS3DH supports SPI, so it would be certainly be fast, and perhaps you could clock them all from one line, sending them identical commands, etc. and then read each chips SPI out separately.
I haven't worked through this but it sounds good in theory!
What are you using for 20hz GPS?
RickInTexas
I'm running my I2C bus at ~450kHz, and so far it's proven to be 100% reliable with 400kHz max rating devices. I've been able to get it faster than that, but so far haven't needed to.
I'm guessing the Venus GPS: https://www.sparkfun.com/products/11058
How about adding a i2c 8-channel switch (PCA9548A) that uses 2 prop-pins for 8 identical address devices? Its quite easy to use.