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 Problem- how can master cpu know which slave chip work

Status
Not open for further replies.

timerc

Newbie level 6
Joined
Nov 22, 2008
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,358
I2C Problem

I have a I2C problem.In a I2C,it can control many chips .But how can the master cpu kown which slave chip to work.I read the I2C guide ,but I just not know how to selecet the slave chips.
I saw a example program ,only founde the program sent a address command to de bus.But how it kown the slave chip's address.
I just want to know how to set the address of the chips,so that I can decide which chip to work.
very thanks to !
 

Re: I2C Problem

Hi!
You can put the master to "enumerate" the available slaves on the bus, by sending write address transactions (R/W bit is 0).
The address field will take the all values in the bit format (7bit or 10bit addressing) except protocol reserved addresses.

The slaves on the bus will ACK (acknowledge) their own address so the master "sees" the active slaves on the bus.
 

Re: I2C Problem

Hi,
The slave device data sheet will specify the addressing scheme for the device. When you design the system you should take care that the addresses on the buss do not clash.
Regards,
Laktronics
 

Re: I2C Problem

THANKS FOR ANSWERS!
but if I have same kind of chips like three eeprom chips on the bus ,how can I know which one to be choose .The address command have bits to set ,but I don't know which one first .
if I write data to one,how can I get my data back.
The device know their address auto?
 

Re: I2C Problem

Hi,
What is the part number of the device you are using, some of them have external address lines for wiring the address uniquely.

Regards,
Laktronics
 

Re: I2C Problem

Hi,

For example in a serial eeprom like 24LC128, there are 3 pins (A2,A1,A0) on the IC which allows the user to assign an adress from 2^3=8 different adresses to each device. According to the device adressing section of its datasheet, the adress of each device is in the form of 1010 A2 A1 A0. This means if you connect all three pins to GND, then the adress of that device will be 1010000. Similarly, it will be 1010111 if you connect all three pins to VCC.

If you have 3 serial eeproms like 24LCXXX in your circuit, you should wire these three pins differently in each device so that they all have a unique adress you can use to read/write.

I've given this as an example, the adressing scheme may vary for different device families.

Regards.
 

Re: I2C Problem

thanks very much!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top