UART baud rate calculator

BRR/UBRR divisor, actual baud rate and error for STM32, AVR and generic UARTs.

How to use it

  1. Choose the UART type (STM32, AVR or generic) and the clock.
  2. Enter the baud rate you want.
  3. Copy the divisor and check the actual rate and its error.

Questions

How much error is acceptable?

Under about 2 % between the two ends usually works for 8N1; the closer to 0 % the better, especially at high rates.

Why can I not get exactly 115200?

The UART divides its clock by a whole number (STM32 adds a fractional part), so most clock and baud pairs leave a small error. A clock that is a multiple of the baud rate gives none.

Related tools

Also useful for: brr, ubrr, usartdiv, usart, lpuart, oversampling, over8, u2x, baud error, serial clock.