User Tools

Site Tools


snippets:uart_baud_rate

Possible baud rates for UART (RS232, RS485, RS422, virtual COM port over USB)

This site describes the difference between desired and actually achievable baud rates.
(Important only for high baud rates)

Formula

The achievable baud rates can be calculated trough this formula:

baud rate = peripheral speed / (16 * divisor value)

The divisor value is automatically calculated by the ZBrain-SDK according to the desired baud rate.(The divisor value is not user setable).
Since the divisor value is an integer value not every baud rate can be set to the exact value. The higher the baud rate, the smaller the chance to be able to set a matching baud rate at the other side of the line.

Example

The achievable baud rates can be tested with the uart test speed example.

Table

The following table is an example for the ZMC running at full speed (default). The peripheral speed in that case is 131,25MHz

:!: Due to a rounding error the divisor value might be 1 higher than expected. This causes a non significant error for lower baud rates. In order to set the correct baud rate value for higher baud rates (divisor value < 100) , the value from the right column (achieved baud rate) rounded towards next lower integer value should be used in the diagram.

standard baud rate divisor value achieved baud rate
300 27344 300.00
600 13672 599.99
1200 6836 1199.99
1800 4557 1800.12
2400 3418 2399.98
4800 1709 4799.96
7200 1139 7202.04
9200 892 9196.33
14400 570 14391.45
19200 427 19211.07
38400 214 38332.36
57600 142 57768.49
115200 71 115536.97
230400 36 227864.58
460800 18 455729.17
15 546875.00
16 512695.31
15 546875.00
14 585937.50
13 631009.62
12 683593.75
11 745738.64
vvv might not work vvv
10 820312.50
921600 9 911458.33
8 1025390.63
7 1171875.00
6 1367187.50
5 1640625.00
4 2050781.25
3 2734375.00
2 4101562.50
1 8203125.00
snippets/uart_baud_rate.txt · Last modified: 2017/11/07 22:26 (external edit)