This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
While debugging my I2C master code, I observed that when I initiate a read or write to a slave that does not exist, the address byte is correctly NACKed (seen on oscilloscope and ADRACK is set in I2CMCS), but the data byte is still transmitted (also seen on oscilloscope). Is it correct behavior for a data byte to be transmitted if the slave address was NACKed?
HI Doug,
The state machine might have started the data byte before seeing the NACK. The important thing is that the I2C master must generate a STOP condition after receiving the NACK to abort the current transfer. Do you see the STOP generated?
Charles,
Yes, I see a STOP after the data byte is NACKed, although I expected the STOP to be generated after the address was NACKed. I do not think the I2C slave I am addressing will care that the data byte is transmitted if it NACKs its own address. My main concern is that I have configured the microcontroller's I2C registers correctly, which I think I have. Thanks for your help!