This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unexpected interrupt by UCA0TXIFG

Other Parts Discussed in Thread: MSP430FG4618

Hi

I use Code Composer Studio 6.0.0 and debug MSP430fg4618.
Now I'm trying to use I2C with USCI_Bx modules.
Unexpected interrupt by UCA0TXIFG, however, occurs and a program cannot exit from __interrupt function.


Here is the code ____interrupt function

// USCI_B0 Data ISR
#pragma vector = USCIAB0TX_VECTOR
__interrupt void USCIAB0TX_ISR(void)
{

  if(IFG2&UCB0TXIFG)                        // Check for I2C TX
  {
   if(queue_num){
     UCB0TXBUF = data_queue[queue_num - 1];               // Load TX buffer
     queue_num --;
    }else{
      UCB0CTL1 |= UCTXSTP;                  // I2C stop condition
      IFG2 &= ~UCB0TXIFG;                   // Clear USCI_B0 TX int flag
      __bic_SR_register_on_exit(CPUOFF + GIE);      // Exit LPM0
    }
  }
}

When unexpected interrupt by UCA0TXIFG, a program goes to __interrupt void USCIAB0TX_ISR(void) and loops in this function because UCA0TXIFG will not clear.
At that time, IE2 value is  0x1C and IFG2 value is 0x22, so UCA0TXIE value is 0.
Is there any situation in which interrupt by UCA0TXIFG occurs even even though UCA0TXIE value is 0?


Thank you in advance,

Shirai

**Attention** This is a public forum