Part Number:MSP430F5659
Hi,
I'm using a homemade driver for I2C communication between my MSP430 (F5659) µC as master and another chip.
It mostly works well but I've surprised it in a situation that I can't explain with the datasheet.
The bug happened after a possible CEM perturbation from my test bench into the I2C lines, but once the I2C periphal is in this state I reproduce it every time I start a transmission and see the same thing at each loop (without further spike around).
I'm in master mode. The bus starts in a correct state with SDA and SCLK both high. What my driver does to try sending is the following sequence:
- set the slave address
- set Transmit mode (UCTR = 1)
- send start (STT = 1)
- wait Tx Flag
then the rest consist in a repeated start and reads but even with a breakpoint here i've someting strange already:
the start is sent but not followed by the slave address as it should, instead the MSP sends the content of the data buffer TX BUFF
I guess I've managed to set the I2C state machine in a wrong state before this sequence, but I can't see any situation in which a start on the bus is not followed by the slave address.
Is there any case where it is possible ?
If the MSP believed it's just another byte to send, would it seem to send a start on the bus by lowering SDA with a high clock ?
Here is what my oscilloscope sees when I run the sequence.
06 is the content of the TXBUFF, when the slave's address is 0x044 in I2CSA, as confirmed before and after with the debugger.
Obviously the slave doesn't recognize the address and does'nt Ack, so my driver sends a STOP. Then I can reproduce it over and over.