View previous topic :: View next topic |
Author |
Message |
karth
Joined: 10 Sep 2003 Posts: 29
|
I2C_how do i switch from Master to Slave and Vice-Versa??? |
Posted: Thu Aug 05, 2004 8:49 am |
|
|
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
|
|
Posted: Thu Aug 05, 2004 10:00 am |
|
|
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 |
|
|
|