In the (eUSCI) – I2C Mode, as the userguide show "The UCRXIFG0 interrupt flag is set when a character is received and loaded into UCBxRXBUF","UCRXIFGx is automatically reset when UCxRXBUF is read".
So I want to check the UCRXIFG0 flag to read the UCBRXBUF data in the main loop.code is following:
while(1)
{
while(!(UCB0IFG & UCRXIFG0));
RxData = UCB0RXBUF ;
}
But I found it is not successful !!!
So I check the UCB0IFG register in the USCI_B0_ISR(void) . I found UCRXIFG0 is set when the UCB0RXBUF is read and UCRXIFG0 is not set when the program into the receive Interrupt service function!!! What's wrong???