Ok, I have tried EVERYTHING possible in trying to get this I2C working, but I can't :-( I have gone back to trying to get a successful ACK now, and can't do it. Here is the code I'm using below, just to write one byte of data (the address 1001 0000)... using an 16f877 with Port C pins 3 and 4. And I have checked all my #define's to make sure they refer to the right thing. Help PLEASE!!! TGetTemp bank1 movlw b'00011000' iorwf TRISC,f movlw 0x09 ;This will hold our Baud Rate! movwf SSPADD bcf SSPSTAT,6 ; select I2C input levels bcf SSPSTAT,7 ; bank0 movlw b'00101000' movwf SSPCON bank1 bsf _SEN ;Enable the start bit tx. btfsc _SEN ;Check to see when it's done. goto $-1 bank0 movlw b'10010000' ;Move the address and tx it. movwf SSPBUF bank1 btfsc SSPSTAT,R_W ;Check to see when it's done. goto $-1 movlw 0x00 btfss _ACKSTAT ;successful if the ACKSTAT bit is clear. 1 = success. movlw 0x01 bank0 call LCDBin ;Print either 0 or 1. return Quoting Martin.Buehler@KEYMILE.COM: > that's not too odd. > i only use software i2c as this allows me to run i2c at 1kHz, allowing > long distance i2c. > it also allows me to use the same periphery drivers on all pics. > tino > > > > > > "Alan B. Pearce" > Gesendet von: pic microcontroller discussion list > 03.02.03 16:33 > Bitte antworten an pic microcontroller discussion list > > > An: PICLIST@MITVMA.MIT.EDU > Kopie: > Thema: Re: [PIC]: f877 I2C routines > > > >And I shouldn't be communicating using bsf/bcf on > >the ports.. instead use the TRIS bits? This seems odd. > > What is even more odd is why you seem to be using a software bit bang of > the > I2C instead of using the internal MSSP I2C hardware. Your subject line > says > you are using an 877 which has this and it is real easy to use. > > And yes, you should be using pull up resistors on both the clock and data > line as your PIC should have both lines as "open collector" types. This is > done automatically by the MSSP hardware, but is why you need to use the > TRIS > registers to set the bits to a 0 state when doing a bit bang > implementation. > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > ---------------------------------------- This mail sent through www.mywaterloo.ca -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body