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
Multiple I2C Peripherals with same Addresses?
-
- Beginner
- Posts: 2
- Joined: Mon Jan 27, 2014 4:18 am
Re: Multiple I2C Peripherals with same Addresses?
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.
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.
Re: Multiple I2C Peripherals with same Addresses?
You would need extra hardware to enable only one sensor on the bus at one time, to prevent bus contention.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
-
- Beginner
- Posts: 8
- Joined: Fri Nov 22, 2013 8:28 am
Re: Multiple I2C Peripherals with same Addresses?
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?
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?
-
- Beginner
- Posts: 2
- Joined: Mon Jan 27, 2014 4:18 am
Re: Multiple I2C Peripherals with same Addresses?
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
Actually, I ended up finding a sensor which allows me to modify the I2C slave addresses of each sensor as I wish
Re: Multiple I2C Peripherals with same Addresses?
That's cool. What make/model has this feature?
Sent from my HTC One using Tapatalk
Sent from my HTC One using Tapatalk