Multiple I2C Peripherals with same Addresses?

Firmware/software/electronics/mechanics
Post Reply
SpilledMyCatNip
Beginner
Posts: 2
Joined: Mon Jan 27, 2014 4:18 am

Multiple I2C Peripherals with same Addresses?

Post by SpilledMyCatNip »

Hey all.

I am currently in the process of 'attempting' to make the crazyflie semi autonomous and I have a quick question to ask. I was planning to implement a few IR sensors on the crazyflie and interface them with I2C. I have some background with I2C and I understand that you can interface the SDA and SCL lines with multiple peripherals in parallel, each with different addresses. But lets assume that I want to use 4 of the same senors, all with the same address. How do I work around this without having the same addresses interfere with each other? :?

Also, I was looking at the schematic provided on the bitcraze website and noticed that the SCL and SDA pins on the expansion header already have the pull up resistors to VCC. I just want to confirm that this indeed correct before I start hitting my head against the wall.

Thanks!
-Peter
doddz
Beginner
Posts: 15
Joined: Mon Jan 06, 2014 9:19 pm

Re: Multiple I2C Peripherals with same Addresses?

Post by doddz »

I don't have much experience with this but I'm just looking at this from a programming point of view thinking it wouldn't be possible with the same addresses as communication would collide.

Maybe some extra hardware to ensure only one sensor is connected to the bus at any time.. Do you know if the manufacturer offers different models, that could be a easier way around. The main problem I see is that I think these addresses are not configurable inside the sensors.
DerShu
Beginner
Posts: 23
Joined: Thu Nov 14, 2013 3:01 pm
Location: Bavaria - Germany

Re: Multiple I2C Peripherals with same Addresses?

Post by DerShu »

SpilledMyCatNip wrote: lets assume that I want to use 4 of the same senors, all with the same address. How do I work around this without having the same addresses interfere with each other? :?
-Peter
You would need extra hardware to enable only one sensor on the bus at one time, to prevent bus contention.
demcanulty
Beginner
Posts: 8
Joined: Fri Nov 22, 2013 8:28 am

Re: Multiple I2C Peripherals with same Addresses?

Post by demcanulty »

I believe what you need there is an I2C hub, something along the lines of the following: http://www.ti.com/lit/ds/scps132a/scps132a.pdf

Or else if there's a chip select on the device itself, you might be able to toggle that. Do you have datasheets for the parts your looking into?
SpilledMyCatNip
Beginner
Posts: 2
Joined: Mon Jan 27, 2014 4:18 am

Re: Multiple I2C Peripherals with same Addresses?

Post by SpilledMyCatNip »

Thank you all for the responses.
Actually, I ended up finding a sensor which allows me to modify the I2C slave addresses of each sensor as I wish :D
doddz
Beginner
Posts: 15
Joined: Mon Jan 06, 2014 9:19 pm

Re: Multiple I2C Peripherals with same Addresses?

Post by doddz »

That's cool. What make/model has this feature?

Sent from my HTC One using Tapatalk
Post Reply