On Tue, 6 Jan 2004 08:41:25 -0000, Michael Rigby-Jones wrote on Re: [PIC:] Pic as an i2c slave: >>-----Original Message----- >>From: Bob Axtell [mailto:cr_axtell@YAHOO.COM] >>Sent: 06 January 2004 00:52 >>To: PICLIST@MITVMA.MIT.EDU >>Subject: Re: [PIC:] Pic as an i2c slave >> >> >>I have a lot of experience with the PIC in I2C applications, >>but always >>when the PIC was the Master, because of timeout issues with the ACK in >>slave mode, and of course the problem that START and STOP events are >>difficult to detect; you can't respond fast enough to satisfy a >>hardware-driven MASTER. >> >>To do this well, the PIC would have to be almost dedicated to ONLY >>servicing the I2C Master and doing nothing else. And it would still be >>too slow. While the C873 and F873/876 families have an I2C START/STOP >>interrupt, it is still too slow for most applications. In a nutshell, >>Microchip isn't very sold on I2C and has no interest in >>designing in a proper I2C engine in the PIC product line. > >It sounds like you haven't thoroughly investigated the datasheet = regarding >the MSSP peripheral. All the components are provided to provide a high >speed (400kbit/s) I2C slave. > >A correctly implemented MASTER device will respond to clock stretching = by >the slave, so the time taken to process each byte by the slave should = not >matter within reason. Most bit bashed I2C masters do not implement = clock >stretching however. This may provide an explanation on why my program basically works, but not on all occurences: Is (are, I have two i2c interfaces as explained in a previous message) the i2C master(s) I use well behaved with this respect?=20 Also, in AN734, there is no clock stretching occuring when the master writes to the slave; this opens the possibility that certain bytes are not "seen" on the receiving side (the slave) because the master has written full speed and the ISR routine for the previous byte has not been fast enough to return in time. I am also thinking of the possibility that the basic compiler I use may mask interrupts when performing certain "special" instructions (or rather macros) such as writing to a LCD display module. This I could find by browsing in the assembler file... * Xrobert.soubie@free.frX (veuillez supprimer les "X") * http://www.astrosurf.com/soubie * Au royaume des aveugles, les borgnes sont mal vus... - P.Dac -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu