i am facing an issue where MSP hangs while checking for UCTXSTT bit.
below is my code:
UCB1I2CSA = ucSlaveAddress;
UCB1CTL1 &= ~UCSWRST;
UCB1CTL1 |= UCTR | UCTXSTT; // I2C tx, start condition
while (((UCB1CTL1 & UCTXSTT) == 0) && (UCB1IFG & UCTXIFG));
if i remove ((UCB1CTL1 & UCTXSTT) and monitor only IFG flag it works and later i am checking for NACK. code works fine without any NACK after start condition is generated.
But why is it hanging when i am checking for UCTXSTT bit. ?