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.

MSP430FR2311: MSP430FR2311

Part Number: MSP430FR2311

Hi,

On the MSP430FR2311 Launchpad I tried the following program. 

The receive interrupt never fires. 

Could you help me figure out what I am doing wrong ?

Thank you so much for your kind assistance

=======================================

#include <msp430.h>

unsigned char RXData = 0;
unsigned char TXData = 0x6;
unsigned int isrCnt = 0;
/**
* serial communication
*/
int main(void)
{


WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
// to activate previously configured port settings

P1DIR |= BIT0;
P1OUT &= ~BIT0; // P1.0 out low
P1OUT |= BIT0;
P1OUT &= ~BIT0; // P1.0 out low

// Configure UART pins
P1SEL0 |= BIT6 | BIT7; // set 2-UART pin as second function

// Configure UART
UCA0CTLW0 |= UCSWRST; // Put eUSCI in reset
UCA0CTLW0 |= UCSSEL__SMCLK;
// Baud Rate calculation
UCA0BR0 = 8; // 1000000/115200 = 8.68
UCA0MCTLW = 0xD600; // 1000000/115200 - INT(1000000/115200)=0.68
// UCBRSx value = 0xD6 (See UG)

UCA0BR1 = 0;
UCA0CTLW0 &= ~UCSWRST; // Initialize eUSCI
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt

while (1)
{
while(!(UCA0IFG & UCTXIFG));
UCA0TXBUF = TXData; // Load data onto buffer

__bis_SR_register(LPM3_bits|GIE); // Enter LPM0
__no_operation(); // For debugger
}
}

#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void)
#else
#error Compiler not supported!
#endif
{
isrCnt++;
switch(__even_in_range(UCA0IV,USCI_UART_UCTXCPTIFG))
{
case USCI_NONE:
break;
case USCI_UART_UCRXIFG:
UCA0IFG &=~ UCRXIFG; // Clear interrupt
RXData = UCA0RXBUF; // Clear buffer
if(RXData != TXData) // Check value
{
P1OUT |= BIT0; // If incorrect turn on P1.0
while(1); // trap CPU
}
TXData++; // increment data byte
__bic_SR_register_on_exit(LPM0_bits); // Exit LPM0 on reti
break;
case USCI_UART_UCTXIFG:
break;
case USCI_UART_UCSTTIFG:
break;
case USCI_UART_UCTXCPTIFG:
break;
}
}

**Attention** This is a public forum