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 support@ccsinfo.com

I2C MultiMaster Problem

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



Joined: 16 Jul 2009
Posts: 4

View user's profile Send private message

I2C MultiMaster Problem
PostPosted: Thu Jul 16, 2009 7:08 am     Reply with quote

Hello
I think the answer to my problem would be multimaster i2c but still I have to ask
I have a circuit which I use 2 16f876 as keypad pics ( this means I have two keypads and these 16fs deals with them and when a key is pressed they send the key value to a 18f452 and it uses it. So far i have done that no problem ( there is still a little problem about pressing the keys of different keypads at the same time but its ok I can live with that Smile) the real problem is that 18f452 has to send a value read from adc channel periodically to the keypad pics(16f876). My 16Fs are master and 18 is a slave so 16Fs request the value when no key is pressed periodically. But here a problem arises. what if one of the 16fs request the value while the other one was sending the key value, and what if both of the 16fs request the adc value at the same time? I have searched a lot but didn't come up with enough resources about multi-master i2c. So if there anyone that can help me through and give me some resources about multimaster i2c, OR any different ideas about the problem, i would appreciate it.
Thanks if you're still reading this long paragraph Smile
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Jul 16, 2009 10:07 am     Reply with quote

You should be doing it the other way around really...

Yes, I2C can be multimaster... but in your app, the 18F should/could be polling the other 2 for keypresses.


If you want "on-demand" -- run indicator lines to the 18F (sorta like an IRQ, but doesn't need to be) for the 18F to poll before querying the I2C bus.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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