SLAZ142I October 2012 – May 2021 MSP430F155
I2C Module
Functional
Master Transmitter Repeat Mode I2CSTP setting error.
When the USART is configured for I2C mode (U0CTL.I2C, SYNC, and I2CEN are set) and the module is configured as an I2C master (U0CTL.MST=1) and repeat mode operation is selected (I2CTCTL.I2CRM=1), the timing of the I2CSTP bit can result in lost data or extra requested transmitted bytes.
Specifically, if interrupts are active during the following two cases:
1) During the time between the setting of the I2CSTP bit and loading of I2CDRB (I2CDRW).
2) For transmitting slave address only, during the time between checking for I2CSTT cleared and setting I2CSTP.
Note: In the second case, the SCL line will be held low until the I2CDRB (I2CDRW) is loaded and then shifted out.
Solution for case #1: disable all interrupts (DINT) before setting I2CSTP then re-enabling after loading of I2CDRB.
Solution for case #2: disable all interrupts (DINT) before setting I2CSTT bit then re-enabling after setting I2CSTP bit.