>I have been trying to implement a basic I2C demonstration >between 2 PIC 16F877s using CCS PIC C. One PIC is the >master and the other the slave. Unfortunately I am a bit >unclear about the wiring and the code. > So, if anyone out there has the inclination, I have a >couple of questions: > >First, do I need to have a common ground between the PICs? Yes, just like RS232 and any other device. The only ones where this may not be necessary are transformer coupled differential or balanced signals. >I have tried the following master and slave code with several >different wiring configurations but none seems to work, any ideas? Get copies of AN734 and AN735 off the Microchip website, and do your C coding just like their assembly coding. The only gotcha in this code is listed in this message in the archive http://www.piclist.com/techref/postbot.asp?by=time&id=piclist/2002/03/24/172 354a&tgt=_top&key=877+I2C+slave+%2D+does+it+work+using+the+MSSP&from= which produces a very long URL that is bound to wrap. as an alternative look for piclist 2002\03\24\172354a Thread: 877 I2C slave - does it work using the MSSP ? -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.