Hi,
I am using the USCI B1 in I2C mode on the F5438 and I am observing a behaviour that is different from what specified in the SLAU208D User guide.
In I2C Master Transmitter Mode (page 478) is showed that after setting UCTXSTT=1 and writing a value in the TX Buffer, two different things (in single master) can happen:
- Slave Address is ACK'ed, UCTXSTT=0 and UCTXIFG is set.
- Slave Address is not ACK'ed, UCTXSTT=0, UCTXIFG stays reset and UCNACKIFG is set.
I can successfully replicate the 1st case.
However, when the ACK is not received after the slave address transmission (for example if no slave is present), UCTXSTT stays set, UCNACKIFG is not set and my software gets stuck.
This is what I do:
UCB1CTL1 |= UCTR;
UCB1CTL1 |= UCTXSTT;
while( (UCB1IFG & UCTXIFG) == 0 );
UCB1TXBUF = value;
while(UCB1CTL1 & UCTXSTT);
The software gets stuck on the 2nd while with the flags value written above.
I dont think it is because of some wrong configuration of the I2C peripheral, because in normal conditions it works fine.
Do you have some ideas?