---------- > Van: Michael Rigby-Jones > Aan: PICLIST@MITVMA.MIT.EDU > Onderwerp: Re: 16C74A I2C-module woes ... > Datum: dinsdag 12 september 2000 13:36 > > > -----Original Message----- > > From: Caisson [SMTP:caisson@TELEBYTE.NL] > > Sent: Tuesday, September 12, 2000 11:32 AM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: 16C74A I2C-module woes ... > > > > Hello , > > > > Yes, it's me again. I'm still trying to get the I2C-module of the > > 16C74a > > to work. After some expirimentation I decided to go-with-the-flow and use > > the method described in the 00734a papers. Well, it workes. As long as > > the master sends a known number of bytes. > > > > And that's my problem. I do not know how many bytes the Master will send. > > My solution was to incoorporate the Start & Stop-bits into the program. > > Well, I can detect the Stop-condition all-right, but the combination of > > bits in the SSPSTAT register for a Start-condition seems to be the same as > > when a NACK is send (well, I mean an ACK is *not* send :-) > I don't quite understand the problem (probably me being thick). Presumably > you have set up a receive buffer in your slave. Ehhh... No. I did not even get that far. I took some code (right outof the 00734.PDF, describing I2C in-SSP-module combination usage), added some debugging output, added a oscilloscope, and checked if it would function. It did not. I could not find the signal that should have appeared when a Start-condition arrives. So I checked some more, and discovered that the the bit-combination in the SSPSTAT register for a Not-ACK-ed byte is the same combination as for a Start-condition ..... And that's the whole problem. I can't seem to be able to keep those two conditions (reliable) apart. For clarity: SSPCON is loaded with 0x2E. I'm only receiving/sending dummy bytes (I do not use a buffer either sending or receiving). Regards, Rudy Wieser -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu