Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ Programming ➜ General ➜ Multiple Slave Devices, Same Addresses

Multiple Slave Devices, Same Addresses

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by JasonP   (1 post)  Bio
Date Wed 04 Mar 2015 07:14 PM (UTC)
Message
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!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 04 Mar 2015 09:33 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,064 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.