I am trying to set the interruption of the UART port in the MSP430FG4618. The same microcontroller is also using Simpliciti.
The configuration of the UART port is the following:
void UartInit(void)
{
UCA0CTL1 |= UCSWRST; //Configure the USCI with the reset bit held high
P4SEL &= ~0x0C0; //P4.7,6 != USCI_A0 RXD/TXD
P2SEL |= 0x30; //Set the USCI to use P2.4 and P2.5 for RX/TX
UCA0CTL1 |= UCSSEL_2; //Use SMCLK
UCA0BR0 = 0x45; //Set Bit Rate to 115200bps with a 8Mhz clock
UCA0BR1 = 0x00;
UCA0MCTL = 0x4A; //Modulation
UCA0CTL1 &= ~UCSWRST; //Done configuring so take USCI out of reset
IFG2 &= ~UCA0RXIFG;
IE2 |= UCA0RXIE; //Enable USCI_A0 RX interrupt <-- THIS IS THE PROBLEM
}
The UART port receives and transmits data without any problem if the line "IE2 |= UCA0RXIE;" is commented.
But once I configure the interruption using that line, then the port does not receive anything (with and without using the "#pragma vector=USCIAB0RX_VECTOR __interrupt void USCIA0RX_ISR (void)" interruption function).
Any suggestion to solve this issue would be great.
Thanks in advance.
gus