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.

MSP430FR2433: UART interrupt never triggered

Part Number: MSP430FR2433
Other Parts Discussed in Thread: MSP-EXP430FR2433, MSP430FR5869

Hello,

I am adding the interrupt functionality from a working UART TX example.

I tried putting a break at the switch case in the interrupt routine but it never triggers.

The code is mostly the same with the example here: dev.ti.com/.../node

Can anyone give me an advice?

Here is the code.

int main(void)
{
    WDTCTL = WDTPW | WDTHOLD;       // stop watchdog timer

    P1DIR = 0x01;
    P1OUT = 0x00;
    P1REN = 0x00;

    P2DIR &= ~BIT3;                 // Set P2.3 as in
    P2REN |= BIT3;                  // enable pull-up/down resistor
    P2OUT |= BIT3;                  // pull-up resistor
    P2IES |= BIT3;                  // enable interrupt

    P1SEL1 &= ~(BIT4 | BIT5);       // USCI_A0 UART operation
    P1SEL0 |= BIT4 | BIT5;

    UCA0CTLW0 |= UCSWRST;           // Put USCI_A0 to software reset
    UCA0CTLW0 |= UCSSEL__SMCLK;     // Use SMCLK(1048576Hz) for baud rate calculation
    UCA0BRW = 9;                    // N = f/BR = 1048576/115200 = 9
    UCA0MCTLW = 8;
    UCA0CTLW0 &= ~UCSWRST;          // Release USCI_A0 software reset
    UCA0IE |= UCRXIE;               // Enable USCI_A0 RX interrupt
    __bis_SR_register(GIE);
    //__bis_SR_register(LPM3_bits|GIE); //LPM3 not work when using SMCLK
    PM5CTL0 &= ~LOCKLPM5;           // Disable the GPIO power-on default high-impedance mode to activate previously configured port settings
    while(1);

}


#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
{
    switch(__even_in_range(UCA0IV,USCI_UART_UCTXCPTIFG))
    {
    case USCI_NONE: break;
    case USCI_UART_UCRXIFG:
        P1OUT ^= 0x01;
        UCA0TXBUF = UCA0RXBUF;
        break;
    case USCI_UART_UCTXIFG: break;
    case USCI_UART_UCSTTIFG: break;
    case USCI_UART_UCTXCPTIFG: break;
    default: break;
  }
}

**Attention** This is a public forum