|
|
View previous topic :: View next topic |
Author |
Message |
i2c_newbie Guest
|
I2C slave interrupt / multi-master system |
Posted: Thu Dec 27, 2007 9:14 am |
|
|
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
|
|
Posted: Thu Dec 27, 2007 10:05 am |
|
|
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! |
|
|
|
|
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
|