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

double ic2

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



Joined: 11 Jun 2005
Posts: 38

View user's profile Send private message

double ic2
PostPosted: Wed Nov 29, 2006 1:40 pm     Reply with quote

hallo to every one i am studing ic2 bus an i am working to my project.
my questions is possible do 2 line to ic2 bus ? example i need comunicate to lcd <--> mcu and mcu<-->gsm module ecc..
but i need comunicate lcd to mcu and mcu to lcd if i do mcu master clock do mcu but not slave device (lcd) i need do clock lcd too.
fore example do c4 c3 (mcu master) c4 c3 lcd(slave) ,a3 a4 lcd(master) and a3 a4 mcu (slave) so i can read data with ssp interupt ? in a (slave) and (master) device ? is possible it ?
thanks
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

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

PostPosted: Thu Nov 30, 2006 8:54 am     Reply with quote

There should only be one master on the i2c bus. Each slave device has a unique address. Depending on how fast you run the I2C bus and how each slave device loads the bus and how long the bus runs, you can get several devices on the same I2C bus.

If a slave device cannot voluteer data back to the master. It must be polled by the bus master. But, if your slave device has a way of driving an interrupt line (not part of the I2C bus) it can let the master device know there is data to read. Otherwise you would set up a polling loop or timer/interrupt in the master and check the slave device(s) on a regular basis.

-- added 12/1
rneilson's point about the standard allowing multiple masters is valid. However I still say you should not have multiple masters on the same bus. As he points out, it does raise the complexity of the design considerably. Since the original poster is asking some basic I2C questions, then they should keep things as simple as possible. One master and some number of slaves, each with a different address.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!


Last edited by rwyoung on Fri Dec 01, 2006 4:54 pm; edited 1 time in total
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Nov 30, 2006 9:24 am     Reply with quote

It is possible to have multiple Masters on the same I2C bus but only one can have control of the bus at any given moment. There is an established protocol that the mutiple Masters will use to negotiate who is going to end up taking control, if more than one start talking at the same time. The Master is the MCU that generates all of the clocks for the bus. A Master can be a Master sender (sending data out to a Slave device) or a Master receiver (receiving data from a Slave device). A Slave can be in receiving or sending mode depending on what the Master is telling it to do. The nice thing about addressing is that you can have multiple I2C components on the same bus and talk to one of them without getting interference from the others. I can only imagine the reason for needing to have multiple I2C busses is if you have multiple I2C devices with the same 'hardwired' address or if a component isn't 100% I2C compatible.

Ronald
ferrarilib



Joined: 11 Jun 2005
Posts: 38

View user's profile Send private message

PostPosted: Thu Nov 30, 2006 1:27 pm     Reply with quote

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