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.

RTOS/TMDSIDK437X: UART 460800bps baudrate error

Part Number: TMDSIDK437X

Tool/software: TI-RTOS

Dear All,

I'm working with Processor SDK RTOS for AM437x 4.0.2 and I've initialized UART1 as follows:

1
2
3
4
5
6
7
UART_Param.baudRate = 460800;
UART_Param.parityType = UART_PAR_EVEN;
UART_Param.writeDataMode = UART_DATA_BINARY;
UART_Param.readDataMode = UART_DATA_BINARY;
UART_Param.readReturnMode = UART_RETURN_FULL;
UART_Param.readEcho = UART_ECHO_OFF;
UART = UART_open(1, &UART_Param);

However, by looking at UART frames via oscilloscope, I see framing errors and baudrate seems to be 480kbaud.

In the Technical Reference Manual Table 21-6 the baudrate is listed and should have an error 0,16%.

But the library seems to use always UART16x_OPER_MODE for Divisor calculation and not UART13x_OPER_MODE like shown in the Technical Reference Manual

What am I missing?

  • The RTOS team have been notified. They will respond here.
  • Hi,

    I looked at the UART driver, it seems the routine:
    /* Computing the Divisor Value for params.baudRate */

    Edited:

    divisorValue = UARTDivisorValCompute(hwAttrs->frequency,
    object->params.baudRate,
    UART16x_OPER_MODE,
    UART_MIR_OVERSAMPLING_RATE_42);

    used the 16x oversampling rate. The function clock is 48MHz, from Table 21-6 of TRM, to achieve 460800 bps, it should use 13x oversampling rate and divisor 8 for this. I will check with the dev team for this.

    Regards, Eric

  • Hi,

    I think a good solution is, for a required UART baud rate, using math to calculate either 16x and 13x, and select the setting with the least error. But we don't have this implemented yet, and we hard coded 16x.

    For your 460800 bps, are you able to change UART_v1.c:
    divisorValue = UARTDivisorValCompute(hwAttrs->frequency,
    object->params.baudRate,
    UART16x_OPER_MODE,
    UART_MIR_OVERSAMPLING_RATE_42);

    UARTOperatingModeSelect(hwAttrs->baseAddr, UART16x_OPER_MODE);

    to UART13x_OPER_MODE and rebuild the UART library for this?

    Regards, Eric
  • Hi,

    i allready implemented a fix, that works for all listed baudrates from the Table from the reference manual. But the best solution should be your suggested one.

    Hopefully this will be implemented for the next RTOS Version.

    Regards

    Frank