> -----Original Message----- > From: Barry King [SMTP:barry@NRGSYSTEMS.COM] > Sent: Thursday, January 04, 2001 3:01 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [EE]: I2C Question > > To be robust, one must handle the cases where the master is reading > more bytes then the slave transmitter is expecting to supply. Most > notably, if your PIC SSP module is doing a slave transmit, it WILL > LOCK SCL low while waiting for the next byte to be loaded into the > SSP. Firmware MUST supply another byte if the master asks (by ACKing > the previous byte), even if the byte count is "wrong". I got bit by > this when I had bus errors. The slave thought he sent all his bytes > then went back to doing something else and left the SSP holding SCL > low, locking up the bus. The only way to get the SSP out of slave > transmit mode (short of resetting the SSP) is to have the master NACK > that last byte. > This is exactly why I asked the question. I knew of this problem and had coded my master software accordingly to send a NACK after the last byte. However, after re-reading the Philips guide I wasn't sure if this was correct, so I tried not sending anything after the last byte which also worked fine. Due to popular opinion I've switched back to sending the NACK :o) Regards Mike -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.