BRR/UBRR divisor, actual baud rate and error for STM32, AVR and generic UARTs.
Free
No sign-up
Nothing uploaded: files are read in your browser
Works offline after the first visit
How to use it
Choose the UART type (STM32, AVR or generic) and the clock.
Enter the baud rate you want.
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.
CAN bit timing calculator: Prescaler, time quanta, sample point and register values for a clock and bit rate.
Serial terminal (Web Serial): UART console in the browser: baud, parity, text/hex, timestamps, log to file, macros, DTR/RTS; a live plotter and send/expect scripts.
Electronics calculators: Divider/ADC, NTC, pull-ups, RC/PWM filter, wire drop, power and heat, CAN bus length.
Also useful for: brr, ubrr, usartdiv, usart, lpuart, oversampling, over8, u2x, baud error, serial clock.