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 ) 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
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
Posted: Thu Jul 16, 2009 10:07 am
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
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