Tuesday 30 August 2016

serial - How to resolve I2C address clashes?


I want to connect multiple I2C slave devices to a micro controller all on the same set of pins but the I2C devices all share the same address. The addresses are fixed in the hardware.


Is there any way to connect multiple devices with the same address?


Perhaps some kind of I2C address translation module with each device with an configurable address so I can assign my own addresses to each one.



Answer



There is nothing built into I2C to do this, normally slave devices will have some externals pins that can be set to 0 or 1 to toggle a couple of the address bits to avoid this issue. Alternatively I've dealt with a few manufacturers that have 4 or 5 part numbers for a part, the only difference being its I2C address.


Most devices have specific hardware that handles the I2C communication, that is the slave ACK is in hardware so you really can't hack around it.


As for the translation module, you could buy some $0.50 PIC's with 2 I2C buses and write some quick code to make them act as address translators i guess.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...