I am using MSP430G2955 and I am unable to receive RX interrupt but I am able to see that RXBUF has been filled with the data sent from a host PC.
I have enabled the GIE and also the RXIE, so is there anything else which needs to be set.
#define TXLED BIT0
#define RXLED BIT1
#define TXD BIT5
#define RXD BIT4
const char SendString[] = { "Received 56 bytes of data\r\n" };
char RecString[56];
unsigned int nRecStringCount; // counter for bytes recevied
unsigned int nCount; //Counter
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0TX_ISR(void)
{
//some stuffs here
}
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
//Some stuffs here
}
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
DCOCTL = 0; // Select lowest DCOx and MODx settings
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
P2DIR |= 0xFF; // All P2.x outputs
P2OUT &= 0x00; // All P2.x reset
P3SEL |= RXD + TXD ; // P1.1 = RXD, P1.2=TXD
P3SEL2 |= RXD + TXD ; // P1.1 = RXD, P1.2=TXD
P2DIR |= RXLED + TXLED;
P2OUT &= 0x00;
UCA0CTL0 |= UCPEN + UCPAR ; // for Even parity
UCA0CTL1 |= UCSSEL_2 ; // 2 for SMCLKm, 1 for ACLK
UCA0BR0 = 0x34; // 1MHz 19200
UCA0BR1 = 0x00; // 1MHz 19200
UCA0MCTL = UCBRS0 ;//+ UCBRS2; // Modulation UCBRSx = 5
nRecStringCount = 0;
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
LPM0 + GIE; // Enter LPM0 w/ int until Byte RXed
while (1)
{ }
}
Also to note that I have recieved that the data sent 0xAB from a remote PC to UART port of the controller.