Dave Reinagel wrote: > > I found a few strange things during debug. > I run my slaves in interrupt mode, and at the end of each write sequence, > I got an interrupt indicating that a read operation was required, > which was a bogus event. To fix that, I made a state machine to detect > a read interrupt immediately after the end of a write operation, to > dump the reading, and all my problems went away. I've had hassles with Microchip's I2C slave hardware. Such as the R/W flag is only valid after the address byte is received. After that it becomes the ACK/NACK flag for data bytes. So I have to copy the R/W flag somewhere safe for later data. I also had problems with I2C masters that don't send NACK on the last byte. So I get a surplus byte request interrupt which I have to service by sending a dummy byte with d7 = high. I wonder if your bug is a similar effect. Does your bug happen frequently or rarely? I'm having problems where I'm reading an EEPROM which involves writing (the EEPROM internal data pointer) and I occasionally get an error. > But another warning... Am I the only one getting rather cheesed off with all the irritating weird things about the PIC that you have to find out the hard way? I wonder how the original designers tested the PIC before they said "yep, this design works".