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.

MSP430FR4133 Receive interrupt flag UCRXIFG is not set even when the character is sent to the MCU

Other Parts Discussed in Thread: MSP430FR4133

I am trying to interrupt the MCU by sending characters to it on the RX line (P1.1) on the MSP430FR4133 Launchpad Board. I am using UART0 in asynchronous mode with 115200 bps baud rate. I can transmit characters successfully from the MCU to PC but cannot receive the characters sent from the PC on the MCU.

I dont know if the problem is due to the pin 1.1 not configured as a UART pin, or something else inside the UART.

I have used only the following code line to configure the GPIO for P1.0 (TX), but I am not sure what to use for P1.1(RX) since P1SEL1 is undefined for the MCU.

P1SEL0 = 0x01;

I am using Tera Term on Win7 PC (with correct baud rate and stop bit settings) to send characters to the MCU.

The global interrupt enable (GIE) is disabled along with the UART receive interrupt.

My code to initialize the UART is:

void uart_init()
{


//Set Bit 0 in UCA0CTLW0 to set uart parameters
UCA0CTLW0 |= UCSWRST;

//Set UART registers for data and baud rate
//Set UART register UCA0CTLW0
//UCA0CTLW0 = 0x0091;
UCA0CTLW0 &= ~UCPEN;
UCA0CTLW0 &= ~UCMSB;
UCA0CTLW0 &= ~UC7BIT;
UCA0CTLW0 &= ~UCSPB;
UCA0CTLW0 &= ~UCMODE1;
UCA0CTLW0 &= ~UCMODE0;
UCA0CTLW0 &= ~UCSYNC;
UCA0CTLW0 |= UCSSEL1;
UCA0CTLW0 &= ~UCSSEL0;
UCA0CTLW0 |= UCRXEIE;
UCA0CTLW0 &= ~UCDORM;

//Set UART register UCA0CTLW1
UCA0CTLW1 = 0x0003;

//Set UART register UCA0BRW
UCA0BRW = 0x0008;

//Set UART register UCA0MCTLW
UCA0MCTLW = 0xD600;

//Clear Bit 0 in UCA0CTLW0 to make uart run
UCA0CTLW0 &= ~UCSWRST;
}

Then I am checking for the receive interrupt flag after sending a character from the PC

if(UCA0IFG &= UCRXIFG)
{
//If flag is set, send command
//uart_send_data(command);
return 1;
}

But the receive interrupt flag is never set.

Please help me with this.

Thanks.

**Attention** This is a public forum