Work out uart baud rate error instantly with clear inputs, formula shown and shareable results.
The UART divides its clock by an integer, so most clock and baud combinations cannot be hit exactly. Rounding the divisor produces an error, and since the receiver samples the stop bit after ten bit times, accumulated error must stay under roughly 2% to avoid framing errors.
Baud divisor
divisor = round(f / (baud x oversampling)); error = (actual - target) / target
Error accumulates over the frame. After 9-10 bit times a 2% error has shifted sampling by 20% of a bit, which starts clipping the stop bit.
Because they divide exactly into every standard baud rate, giving zero error. 16 MHz does not, which is why 115200 baud from 16 MHz carries about 2.1% error at 16x oversampling.