CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

I2C protocol

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
younus_noman



Joined: 04 Jul 2005
Posts: 9

View user's profile Send private message

I2C protocol
PostPosted: Mon Jul 11, 2005 12:17 am     Reply with quote

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: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: I2C protocol
PostPosted: Mon Jul 11, 2005 1:08 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Mon Jul 11, 2005 10:05 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jul 11, 2005 8:30 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Mon Jul 11, 2005 9:37 pm     Reply with quote

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







PostPosted: Tue Jul 12, 2005 9:28 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 12, 2005 12:38 pm     Reply with quote

Note that if you enable interrupt on start and stop that you will get those interrupts whether your address matches or not.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group