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.

LP-MSPM0G3507: Uart Data Mismatch

Part Number: LP-MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello TI Experts,

I am working with the G3507 board and using the UART peripheral in interrupt mode (RX only). When I send data from the serial monitor, I receive the expected data but also some additional garbage characters.

Could you please help me identify the cause? I have attached the UART code and configuration details below for your reference.

#include "ti_msp_dl_config.h"

volatile uint8_t gEchoData = 0;
int main(void)
{
    SYSCFG_DL_init();

    NVIC_ClearPendingIRQ(UART_1_INST_INT_IRQN);
    NVIC_EnableIRQ(UART_1_INST_INT_IRQN);
    DL_SYSCTL_enableSleepOnExit();

    while (1) {
        __WFI();
    }
}

void UART_1_INST_IRQHandler(void)
{
    switch (DL_UART_Main_getPendingInterrupt(UART_1_INST)) {
        case DL_UART_MAIN_IIDX_RX:
            DL_GPIO_togglePins(GPIO_LEDS_PORT,
                GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_TEST_PIN);
            gEchoData = DL_UART_Main_receiveData(UART_1_INST);
            DL_UART_Main_transmitData(UART_1_INST, gEchoData);
            break;
        default:
            break;
    }
}

Thank You
Amara Rakesh.

  • The fact that there are always 4 extra bytes suggests that something is over-reading the FIFO, but I don't see that in the code you posted. Have you changed anything in Sysconfig from the original Example (it looks like "uart_echo_interrupts_standby")?

    What is at the other end of the wire(s)? You mentioned "the serial monitor"; is that a (PC) terminal emulator?

  • The data you show seems to be output from the transmit side. So was the data received on the other end incorrectly and the bad data echoed, or was it received correctly and garbled when echoed? No way to tell from this.

    Lots of ways to attack this.

    You could loop back the signal from the transmit side to verify that is working as expected.

    You could change the MSPM0 code to just transmit a string.

    Or just receive a string. Setting a breakpoint and checking the buffer.

  • Yeah I changes the UART, example comes with UART0, but I changes to UART1. and I solved the issue my commenting the Below line in the code
    //__WFI();
    so, my code is working expected.

    Is it ok?

    and sometimes the Reset button is working an expected, any idea?

  • Hi Amara,

    I think it is because you are using BUSCLK for UART. But once you have __WFI((); to make MCU enter into low power, the BUSCLK would be stoped. And that's why you last ~2 byte can not be received correctly.

    Regards,

    Zoey

  • Hai Zoey, 

             Yeah, this is the reason and why sometimes the RESET button is not working.

    Regards,

    Amara

**Attention** This is a public forum