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

I2C access when another master

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



Joined: 08 Sep 2003
Posts: 2

View user's profile Send private message

I2C access when another master
PostPosted: Tue Aug 24, 2004 11:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Aug 24, 2004 12:18 pm     Reply with quote

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. Twisted Evil

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

View user's profile Send private message

PostPosted: Tue Aug 24, 2004 12:21 pm     Reply with quote

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.
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