Tool/software:
How to configure the serial port of MCU2_0 to obtain an accurate baud rate of 460800?
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.
Tool/software:
How to configure the serial port of MCU2_0 to obtain an accurate baud rate of 460800?
Hi,
You can update the baud rate when initializing the UART instance. You will have to update the UART params before opening the UART instance.
For example:
UART_Handle uart = NULL; UART_Transaction transaction; UART_Params uartParams; UART_Params_init(&uartParams); uartParams.baudRate = 460800; uart = UART_open(uartTestInstance, &uartParams);
Thanks,
Neehar
Hi ,
According to the calculation formula baudRate = (moduleClk)/(mirOverSampRate * divisorValue), the best calculation result close to 460800 is 461538, and a relatively accurate 460800 cannot be obtained. Can you provide configuration parameters with less error?
Thanks,
Hi,
Let me look into this further and get back to you tomorrow.
Thanks,
Neehar
Hi,
For details, see 12.1.6.2.1.3 UART Protocol and Data Format. Set HwAtr to UART13x_OPER_MODE and baud rate to 460800. Then, you can directly communicate with the PC serial debugging tool
Symptom: 1. The baud rate of the serial port debugging tool on the PC is set to 460800, and the data communication between sending and receiving one or two bytes at a time is normal. If more than three bytes of data are sent or received at a time, the communication is abnormal. The serial port debugging tool will continue to receive all zero abnormal data
2. The baud rate of the serial debugging tool on the PC is set to 461538, and the communication is normal.
Thanks,
wangmuzhang
Hi,
Using the formula Divisor value = Operating frequency / (Baud Multiple (13 or 16)× baud rate) if you look at the chart the closest we can get to a baud rate of 460800 is 461540 which has an error percentage of +0.16.
Additionally, I looked into various implementations of changing the operating clock frequency which can be 192MHz, 64MHz, 96MHz, and 48MHz with combinations of UART 16x Mode and UART 13x mode and none of them yield a decimal value for the divisor.
Thanks,
Neehar
Hi,
Could you please tell me howto configure the baud rate of uart to 460800 on the linux side? As well, which register we read to see the current baud rate configuration.
Do I need to change the clock configuration synchronously!
Regrads,
Maxiel
Hi Maxiel,
It won't be possible to configure exactly a baud rate of 460800 as both Linux and RTOS will follow the table I provided above. You will only be able to achieve 461540 with an error percentage of +0.16%.To see the current baud rate, you can access the UART_DLH, UART_DLL for the divisor value and UART_MDR1[2:0] for the baud multiple and use the following formula:
Divisor value = Operating frequency / (Baud Multiple (13 or 16)× baud rate)
Thanks,
Neehar
Hi,
Please Integrate the following changes in RTOS UART Driver to support 460800 Baud-rate.
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/uart_5F00_480600_5F00_support.patch
Best Regards,
Sudheer