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 slave interrupt / multi-master system

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







I2C slave interrupt / multi-master system
PostPosted: Thu Dec 27, 2007 9:14 am     Reply with quote

Hi there,

I'm new to I2C. I have a question regarding the ISR of i2c slave: is the device address handled already when it enters the interrupt routine? After the 'start' bit from master, does the next following byte have to be the slave address?

The reason I'm asking is, I'm working on a project to integrate a slave device into an existing system. The system is multi-master system, and the command stream is like this, sender address, device address, data......... I don't think it's necessary to have the sender's address (while, maybe it's necessary for multi-master system), however it's the way it's already implemented so I'll have to be compliant to this. So would the ISR for I2C slave still be able to identify such stream?

What's more, their system is using NXP chips, and my current design is using PIC. The usage is slightly different, e.g. I was told that for NXP they don't need to specify whether the device is master or slave before the main program, which makes it easy to switch between master and slave. However for PIC, it's not allowed to change during runtime ( I think read this comments from PCM Programmer). So if sometime my device need to act as a master (while most of the time it just receives data), do I need to claim it as a master? Then when it need to receive data (other device is acting as master), how is this handled, still by ISR?

I'm really confused and thanks for all the comments!
i2c_newbie
Guest







PostPosted: Thu Dec 27, 2007 10:05 am     Reply with quote

Well, at a second look at the I2C spec and the spec from my client, I think the slave address will be sent after the START byte. The data stream would be sent after this initial handshaking. Please ignore this question.

But I still have the question regarding the master-receive mode. Please help if you have any experience. Thanks!
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