View previous topic :: View next topic |
Author |
Message |
younus_noman
Joined: 04 Jul 2005 Posts: 9
|
I2C protocol |
Posted: Mon Jul 11, 2005 12:17 am |
|
|
In I2C protocol, when we say
i2c_wirte(address)
Is this address received by all the slaves or it is only received by one slave with the above address specified?
Noman |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
Re: I2C protocol |
Posted: Mon Jul 11, 2005 1:08 am |
|
|
younus_noman wrote: | In I2C protocol, when we say
i2c_wirte(address)
Is this address received by all the slaves or it is only received by one slave with the above address specified?
Noman |
All slaves on the same I2C bus will receive the message. Only the slave(s) configured for the address will respond. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Jul 11, 2005 10:05 am |
|
|
Following a start condition, the next 8 (or 10 depending on addressing) bits are loaded into the SSPSR register. If these match the value in the SSPADD then the data is transferred to the SSPBUF register. You do not have access to the SSPSR register so in reality the write condition will only be received by the device whose address matches. |
|
|
younus_noman
Joined: 04 Jul 2005 Posts: 9
|
|
Posted: Mon Jul 11, 2005 8:30 pm |
|
|
Mark,
So this means that the address is recognized by the hardware and not the software.
Thanks
Noman Younus |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Jul 11, 2005 9:37 pm |
|
|
Well you can recognize it in software but it is the hardware match that allows you to read the data and any subsequent bytes. |
|
|
valemike Guest
|
|
Posted: Tue Jul 12, 2005 9:28 am |
|
|
I think he means:
Will the MSSP module (hardware) recognize it, and filter it before it even gets down to the software (e.g. mssp interrupts, mssp state machine, etc.)?
So yes, only your hardware will know that there is an address mismatch, and is transparent to your software. Only when there is an address match will the MSSP module act, and set the bits that trigger your i2c isr routines. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Jul 12, 2005 12:38 pm |
|
|
Note that if you enable interrupt on start and stop that you will get those interrupts whether your address matches or not. |
|
|
|