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.

MSP430FR2433: EUSCI Uart receive lost data with baudrate 115200

Part Number: MSP430FR2433
Other Parts Discussed in Thread: MSP-EXP430FR2433,

Environment:

-HW: MSP-EXP430FR2433 development kit, connect pin P1.4 and P1.5 to FTDI USB serial, remove RXD TXD jumper which connects to ez_FET Debug.

-IDE: Code Composer Studio Version: 11.1.0.00011 on win 10

I can run eusci_a_uart_ex1_loopbackAdvanced example from msp430_driverlib_2_91_13_01 without any problem. This example uses a baud rate of 115200 bps.

But when I modify the example code to receive a packet from the host PC, it always lost some bytes. For example, when I sent packet "123456789", it received "124578".

For simplicity, From the example code, I only remove the transmit function and add a receive buffer in the interrupt code like the picture below.

When I change the baud rate config to 19200 or 9600, the problem will not occur. Is there any suggestion to fix this problem? 

  • Hi,

    Based on your description, it is related to the high baud rate. That means you have limited time to deal with each received data. I saw in your interrupt routine, is it necessary to run the UART status check function here? You can try to remove this function and test again. 

    Best regards,

    Cash Hao

  • Hi Cash, tks for your answer. I removed the UART status check function and it worked. But if I add some code to put the data to the ring buffer in the interrupt routine, the same problem will have occurred.

    uint16_t RINGBUF_push(ringbuf_t *ring, uint8_t b)
    {
    uint16_t head = NEXT(ring->head, ring->size);
    
    if(head != ring->tail)
    {
    ring->buffer[ring->head] = b;
    ring->head = head;
    return 1;
    }
    return 0;
    }

    So I think I need to optimize the ring buffer code or use DMA instead. Do you have any examples of using DMA in EUSCI UART for reference?

  • Hi,

    I do not think the MSP430FR2433 supports DMA. Why not use a lower baud rate to avoid this issue?

    Best regards,

    Cash Hao 

  • Or you can try to let the MCU run at 8MHz by setting the MCLK to 8MHz. 

**Attention** This is a public forum