Just to clarify for those what do not use the Hi-Tech C compiler. STAT_BF is a macro in the Hi-Tech C compiler that is defined as the BF bit in the SSPSTAT register. ---------- Forwarded Message ---------- Subject: [PIC]: I2C capture byte problem Date: Wed, 11 Jul 2001 09:01:48 -0600 From: Roy Souther To: PICLIST@MITVMA.MIT.EDU My I2C master sends three bytes out the buss then requests one, byte 1 is IC chip address, byte 2 is data, the buss gets reset then it sends the IC chip address again then switches to read mode and gets a byte. The master works great because this exact code works with another slave chip I have that is hardware slave controlled. I just can not get my slave chip that I am making to work. The slave is a 16c73B. Upon receiving the IC chip address I get interrupted with SSPIF set. I then wait in the ISR in a loop until the STAT_BF bit gets set and that should happen right after the second byte is received. It does not ever set the STAT_BF bit though. The STAT_BF is a bit to tell me when the SSPBUF is full. I really need to know after each byte is received. I have tried using the SSPIF but it only interrupts after the first and third byte, the address bytes. It does not get set after the second byte the data byte. Eventually I will figure this out but I would like some suggestions as to things that could cause this to be the problem. -- Roy Souther 01100010 10101110 11000110 11010110 00000100 10110010 10010110 11000110 01001110 11110110 11001110 00010110 10010110 00101110 10000100 10000100 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads ------------------------------------------------------- -- Roy Souther 01100010 10101110 11000110 11010110 00000100 10110010 10010110 11000110 01001110 11110110 11001110 00010110 10010110 00101110 10000100 10000100 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads