If you can re-do your code to use the I2CREAD/I2CWRITE command then you should be good.
If you can re-do your code to use the I2CREAD/I2CWRITE command then you should be good.
Dave
Always wear safety glasses while programming.
Hi,
To expand on Dave's answer a bit... If you're using the I2C peripheral (MSSP module) in the PIC then you must use the pins to which this peripheral is connected (on some PICs you can switch them to alternative pins but I don't think that's possible on the 16F886). If you're using I2CWRITE/I2CREAD, which is bit-banged and doesn't use the MSSP module, you can use "any" pins you want - as long as the pin used for clock can be an output and the pin used for data both in (for I2CREAD) and out (for I2CWRITE).
It's true that the MSSP module (the SCL/SDA pins) HAVE to be used when the PIC is the slave but it CAN equally well be used when the PIC is the master. However, there are no PBP commands to directly "drive" the use of the MSSP module (like there is for the USART etc).
/Henrik.
Really? I never thought about pbp doesn't support slave mode for I2C. This certiainly makes me re think so mtuff I am currently working on. Hmmmm shame.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
When using I2CREAD/WRITE the PIC is "in control" of the line, ie it supplies the clock and is therfor the master (same as with SHIFTIN/OUT). Because of this IC2READ/WRITE won't work for a slave type device, however the MSSP module setup in I2C mode will, you just have to "drive it manually".
/Henrik.
Thanks henrik, just in time to fix what I was doing. I think I did some bit banging slave stuff a few (>5) years ago in ASM, no desire to repeat that!! Off to make sure chip selection supports slave mode I2C.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Bookmarks