Other Parts Discussed in Thread: MSP430F247
HI,
I am having a problem with running an I2C slave on the MSP430F247.
The master initially writes data to the slave which contains a Command byte and some data. It then starts a read sequence to read back data dependant on the command byte.
The receive ISR detects the command byte in the frame and then fills the transmit buffer ready for the read from the master. This means that the ISR for the command byte reception does not complete until partway through, the actual reception of the third data byte. Normally this causes minor SCL stretching between the seventh and eighth SWCL pulse on the third byte. Then the ISR for the second and third byte run with a very short delay in between. Usually this operates very well, but at least once every 24 hours the I2C system hangs up with SCL held low.
I have managed to trap exactly what happens unis a scope and it seems that the error is caused by the fact that the MSP430 does not acknowledge the third data byte but sends a NAK. Consequently the Rx ISR is only called for the first and second bytes, and not the third byte. The effect of the NAK is that the master generates a STOP condition, which is detected and causes the expected interrupt.
I have attached a file which shows the srennshots from the scope and explains this in more detail.
Any help on reasons why the USCI would send a NACK would be appreciated