I am running the UART example, msp430fr599x_euscia0_uart_01, in CCS v8. Running the exact code from Resource Explorer, it will not work reliably when LPM3 is entered, the received character is often garbled. If I modify the code so it can't be put it in LPM3, it works fine.
My PC is sending characters via an FTDI USB to UART cable. It uses 3.3V, so no conversion is necessary. I am using putty for the COM port S/W.
Voltage levels and bit timing look fine on a scope. I don't think it is a H/W issue, since it works fine without LPM3.
Sending 'a' from the PC, gu16UartRecv (new temp variable for troubleshooting)
should be:
0000000001100001b (0x61)
sometimes OK, but often wrong when LPM3 is used:
0000000011011000b
0000000011110110b
So, the problem is in the receipt at the FR5994, not the transmission.
I don't need LPM for this project, but I might for future projects.
Partial code below, lines modified from original noted with @@@. This works, original does not.
...
UCA3IE |= UCRXIE; // Enable USCI_A3 RX interrupt
__bis_SR_register( GIE ); // @@@ Interrupts enabled
while ( 1 ) // @@@ Don't enter LPM
{
}
__bis_SR_register(LPM3_bits | GIE); // Enter LPM3, interrupts enabled
__no_operation(); // For debugger
}
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=EUSCI_A3_VECTOR
__interrupt void USCI_A3_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(EUSCI_A3_VECTOR))) USCI_A3_ISR (void)
#else
#error Compiler not supported!
#endif
{
switch(__even_in_range(UCA3IV, USCI_UART_UCTXCPTIFG))
{
case USCI_NONE: break;
case USCI_UART_UCRXIFG:
while(!(UCA3IFG&UCTXIFG));
gu16UartRecv = UCA3RXBUF; // @@@ Save received char for debug
UCA3TXBUF = gu16UartRecv;
__no_operation();
break;