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_how do i switch from Master to Slave and Vice-Versa???

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



Joined: 10 Sep 2003
Posts: 29

View user's profile Send private message

I2C_how do i switch from Master to Slave and Vice-Versa???
PostPosted: Thu Aug 05, 2004 8:49 am     Reply with quote

Hi guys,

I am trying out the I2C multi-master mode. I am trying to switch from slave to master. I've used the following to configure to slave mode.

#use i2c(SLAVE, SDA=PIN_C4, SCL=PIN_C3, address=NODE_ADDR)

how do i switch to master mode programmatically? a sample code is much appreciated...THANK YOU
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Aug 05, 2004 10:00 am     Reply with quote

If you look in the data-sheet, for your particular PIC, it will tell you that certain bits need to be set to enable Master mode. There is a complete section that talks about I2C communications, Slave mode, Master mode and Multi-Master mode. I would strongly suggest reading up on this as much as possible to become familiar with the hardware side of it. The software then becomes a bit easier when you know what the hardware is doing. I'm sure there has been multiple discussions on Multi-Master I2C so a search would be a good thing to do. Good luck!

Ronald
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