Electronic – What are the options if the I2C slave addresses clash

i2c

Now I have ten accelerator sensors (ADXL345) connected to only one PIC16F887 using I2C.
The problem is ADXL345 only has 2 I2C slave addresses configurable. So it brings conflict.

I know NXP does provide a I2C multiplexer that work around this kind of issue, but I have ten sensors. So it seems of no help.

Best Answer

Ten ADXLs would be 5 pairs with the ALT_ADDRESS pin.

NXP do 2, 4 and 8 channel I2C switches, so you could use an 8-channel switch, which would allow you up to 16 ADXLs.

Alternatively, you could roll your own switch in an ASIC or CPLD.

A third option would be to ditch I2C and use the SPI interface on the ADXL. This would mean more pins from the PIC to select the 10 chips, but couple it with a 4-to-16 decoder and you can select any one of them to communicate on the SPI bus with just 4 pins from the PIC (would allow up to 15 ADXLs if you reserve one address for "no chip selected").