I have rewritten the UART data management state machine to support the UART RX interrupt. However, the UART never generates and interrupt!
// UART initialization.
UCA0CTL1 |= UCSWRST; // Disable the UART.
UCA0CTL0 |= 0x00; // No parity, LSB first, 8-bit character, one stop bit,UART mode, Asynchronous mode
UCA0CTL1 |= 0x40; // ACLK
UCA0MCTL |= UCBRF_3 + UCBRS_5 + UCOS16; // 230,400 baud
UCA0BR0 |= 0x04; // Upper byte of baud rate prescalar
UCA0BR1 |= 0x00; // Lower byte of baud rate prescalar
UCA0CTL1 &= ~UCSWRST; // Enable the UART.
IE2 |= UCA0RXIE; // Enable the UART receive interrupt.
// Copy character in the RX buffer into Serial_Port_Data.
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void) {
_DINT();
Serial_Port_Data = UCA0RXBUF;
System_Flags |= UART_RX_DATA;
_EINT();
}
Regards, Harvey