I2C operation how master recognise a slave

Status
Not open for further replies.

PA3040

Advanced Member level 3
Joined
Aug 1, 2011
Messages
883
Helped
43
Reputation
88
Reaction score
43
Trophy points
1,308
Activity points
6,936
Hi all

Let me know that in I2C operation how master recognise a slave between more slaves
 

its either through hardwired concept or through the address line configuration of the slave devices.
 
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear samba007

can you more explain it please
 

if you have eeprom then it gives you a0,a1,a2 pins so you can connect 8 eeproms of same type
1st eeprom all3 pins ground 0,0,0 (0 is gnd 1 is Vcc)
2nd eeprom Vcc,gnd,gnd 1,0,0
3rd 0,1,0

and so on. this is called hardwired.
in software you have to send address like A0 for 1st eeprom A1 for second like that..
like this depending on the software you send to slave that particular slave will talk to master controller...
hope you understand.
 
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Thanks samba007

you really explain it
let say i need to read 0000 address location of 2402. can I have code in assembly

first step

Code:
movlw   b’00101000’ ; setup value 
                       ;   into W register
banksel SSPCON1     ; select SFR 
                    ;   bank 
movwf   SSPCON1     ; configure for 
                    ;   Master I
2
C
 

you get easy and good codes in
8052.com - The Online 8051/8052 Microcontroller Resource - 8052.com and go to code section there.

but you have to send the i2c frame format with proper address of slave ( a0,a1,a2 pin configuration)
then send memory location where you want to write the data like 0x00 then it writes the data to 0000 location. and it increments the memory location automatically, you need not increment it.
 
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Thanks for reply
Nice link but I know only PIC midrange 16f877a

can I have an example codes for i2c frame format with proper address of slave
 

Every I2C compatible device has its own unique address. The master has to send the unique address. Then the slave whose address matches the address sent by the master pulls the SDA line low. This is acknopwledgment from the slave . Then the master can proceed...
 
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear all
Let say we joint same kind of slave to the bus ( two IC 2402 )
 

There'a a clear explanation in the datasheet:





http://www.atmel.com/dyn/resources/prod_documents/doc0180.pdf


So the first 4 bits of the address byte will be "1010", then the logical states of A2, A1 and A0 pins will follow, and the last bit will initiate the read or write sequence. The slave which has its three address pins hardwired as the three address bits that the master sends (see attached image), should send back an acknowledge.

Hope this helps.
 
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear all
Let say we joint same kind of slave to the bus ( two IC 2402 )

I completely agree with what alexx has said.

By the way hardwired means you have to either pull the pins(A0,A1,A2) high or either low (by externally connecting to +Vcc or Ground). So, total address that can be formed will be equal to 2^3 = 8. So, 8 same type of devices can be connected to the same I2C bus.
 
Last edited:

Embedded_Geek said:

Hi Ajish!

I'm sure you meant 8 and not 16 addresses, something tells me that you did that mistake on purpose just to see if we are paying attention!
 
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear all
what is the advantage of 10bits address mode over 7bit address mode
 

Dear all
what is the advantage of 10bits address mode over 7bit address mode

10 bit addressing gives more addressing capability. More devices can be connected to the same I2C bus.

For better understanding visit the below given site

I2C Bus: 10 Bit Addressing
 
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear all
I2C use restart condition instance of single start condition, what is the advantage in
 


https://ww1.microchip.com/downloads/en/devicedoc/i2c.pdf


The purpose of is to allow combined write/read operations to one or more devices without releasing the bus and thus with the guarantee that the operation is not interrupted.

I2C Bus: Repeated Start Condition



I2C Bus Technical Overview and FAQ - Embedded Systems Academy
 
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear All
Please explain what is the meaning of general call condition in I2C
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…