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.

Simultaneous UART and LCD in MSP-EXP430FR4133

Other Parts Discussed in Thread: MSP430FR4133

I installed the OutOfBox_MSP430FR4133 and I am trying to modify the code to display on the built in LCD data from the UART.  I can get the UART to work correctly and I can get the LCD to work correctly.  But I cannot get both to work.  I use the hal_LCD.c code to initialize the LCD.  And then I use the following code to initialize the UART.  Any thoughts on what my problem is?

int main(void) {

WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

//Initialize all pins
Init_GPIO();
Init_LCD();

P4DIR |= BIT0;
P4OUT &= ~BIT0; // P4.0 out low

//**************************************** UART SETUP ******************************************************************************
PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
// to activate previously configured port settings
// Configure UART pins
P1SEL0 |= BIT0 | BIT1; // 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
//**************************************** UART SETUP ******************************************************************************

showChar('U',pos[0]);
__bis_SR_register(LPM0_bits|GIE); // Enter LPM0
__no_operation(); // For debugger
}

  • What happens when you try to use both?
  • The LCD goes blank when the program is running, but when I go to load the program again the LCD displays the message and then goes blank when the program is reloaded.
  • Hi Tyler,

    I took your code and dropped it into a project - since you only provided a small snippet I had to guess at the rest of it to "fill in the blanks". FR4133_LCD_UART_test.zip

    Using this code I correctly see "U" displayed on the screen, after I click RUN in my debug session.

    I don't know what could be different in our setups - I don't have any more UART code in mine, so I don't know if that could make a difference. Are you receiving things over UART when the issue occurs? Are you able to pause the debug session and see where the code is? What code had you loaded into the part before this one - was it something with LPM3.5 + RTC? The reason I ask is that I've seen settings carry over in that type of situation before until you do a power cycle (because the code can run some and load the registers before the debugger erases/reprograms the part). Usually in those cases you just need to power cycle and do your debug session again and it will disappear.

    Regards,

    Katie

**Attention** This is a public forum