Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I2C bus interfacing with two slaves that have the same address

Status
Not open for further replies.

angelolobo

Newbie level 3
Joined
Jan 12, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,315
Hello,

I will be using the I2C bus for an application that will sample data from a sensor and process this data. The problem that I have is thiS:
The sensor I have selected has an I2C address (like all I2C devices). But, I need to interface three such sensors to my bus into the processor.
How would I do this??

Thanks,
Angelo.
 

Hi,

Normally, if manufacture has defined that I2C slave-address; then they may produce same sensors with several I2C slave-addresses.

This will enable to connect several sensors (devices) to a single I2C. When you order, you should select these sensors to have different I2C addresses. You may check their data-sheet for details.

Thank you
 

Hi,

I am using the ADXL345.

Angelo.

---------- Post added at 17:23 ---------- Previous post was at 17:21 ----------

I also hav a restriction to use only 2 wires or 1 set.
Angelo.
 

the 7-bit I2C address for the device is 0x1D, followed by the R/Figure 8Table 11Figure 10Figure 9W bit. This translates to 0x3A for a write and 0x3B for a read. An the 7-bit I2C address for the device is 0x1D, followed by the R/Figure 8Table 11Figure 10Figure 9W bit. This translates to 0x3A for a write and 0x3B for a read. An alternate I2C address of 0x53 (followed by the R/W bit) can be chosen by grounding the SDO/ALT ADDRESS pin (Pin 12).(followed by the R/W bit) can be chosen by grounding the SDO/ALT ADDRESS pin (Pin 12).


you can use 0x1D and 0x53 as device address .. the data sheet has mentioned about it in 10 of 24 in https://www.sparkfun.com/datasheets/Sensors/Accelerometer/ADXL345.pdf
 
ckshivaram :

I have gone through this before.(Thanks all the same!) This scheme can work for 2 identical devices on the bus. But if I have to add another device on the bus, it doesnt help push forward.

Any ideas yet, anyone?

Angelo.
 

Why don't you use SPI?
You can connect all three devices to one SPI bus and just use the chip-select input to point which device you're working with atm.
 

You have to use a manual hw chip select. Your processor/software on a GPIO will enable the chip you want to comm with.

Some chips have external pin select for two different address options.
 

You can use software i2c with different sda (or scl) for each slave, or hardware i2c + multiplexor IC (scl may be multiplexed).
 

i have two sensors with diff slave address. can i read them at same time on same port?
 

Not simultaneously, but you can read one followed by the other when they are on the same bus with different addresses.

Keith
 

Not simultaneously, but you can read one followed by the other when they are on the same bus with different addresses.

Keith

thank you very much keith,
so i can not send two slave address and read two sensors,
i have to send one address and read that sensor
and then send second slave address and read second sensor in next bus??
 

Correct. Only one device can write to the bus at any one time so it has to be sequential. Maybe to can send a command which will cause any or all devices to transmit, I am not sure, but there will be a clash if they do.

Keith
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top