View previous topic :: View next topic |
Author |
Message |
benri
Joined: 08 Sep 2003 Posts: 2
|
I2C access when another master |
Posted: Tue Aug 24, 2004 11:39 am |
|
|
Hi, all
I hope someone can help me up.
The problem I have is:
PIC is the master device to access EEPROM, and we have another master device also access EEPROM. If I use CCS functions such as WRITE_EEPROM( ). How can I know another master not access EEPROM?
Can anyone give me examples to help me up?
Thanks.
Benri |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Tue Aug 24, 2004 12:18 pm |
|
|
This I2C bus is designed to have multiple Masters connected. There is a protocol that handles bus arbitration in case more than one Master tries to access the bus at the same time. If you have not read the I2C specification yet, I would strongly suggest that you do. There is some good information in that document. It is located at: http://www.semiconductors.philips.com/acrobat/literature/9398/39340011.pdf.
I suggest that you do your homework first (study specifications of hardware, software, research postings) before you start asking for help. Too many times people come here asking for help when they've not even tried to figure things out on their own first. Trial and error is also a good teacher. I remember more when I have to bang my head against the wall a few times while trying to figure out why my project doesn't work.
Also, the function write_eeprom() is used to access the 'Onboard' eeprom of the PIC. It doesn't access the I2C bus. You need to use the i2c_start(), i2c_write(), i2c_read() and i2c_stop() functions to access the I2C bus.
Ronald
Last edited by rnielsen on Tue Aug 24, 2004 12:21 pm; edited 1 time in total |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue Aug 24, 2004 12:21 pm |
|
|
I would connect the EEPROM to only one PIC. Have the second PIC ask the first PIC to fetch EEPROM data for it. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
|