Multiple Slave Devices, Same Addresses

Posted by JasonP on Wed 04 Mar 2015 07:14 PM — 2 posts, 13,640 views.

#0
Hello All,

I am working on an Atmega 328p host controller that manages two atmega 328p based slave devices. A requirement that seems to be challenging is:

--- Each slave device must have the same address so the user does not have to worry about which host he or she plugs into. For example a user might have 10 host units and 20 sensor units. But they need to be able to swap sensors from host to host. I thought I could do this by simply only powering one sensor at a time. However if both sensors are not powered at the same time (like a bus) the I2C bus goes dead? Could this be caused by the impedance state of the powered down sensor "drowning" the SCL and SDA lines? If both are powered on at the same time it works fine. But this requires unique addresses for each sensor.

I have tried setting the pinModes of A4 and A5 to INPUTS (HIGH IMPEDANCE) after a request from the master has been fulfilled and before the sensor gets powered down.


I guess I may have to have transistors to disconnect the SCL and SDA lines to each sensor on power up and power down? Any clever workarounds floating around out there?

Thanks!
Australia Forum Administrator #1
Template:Arduino
Please post Arduino-related questions to the Arduino Forum or to StackExchange: Arduino. This saves splitting questions and answers between this forum and the Arduino ones.