Calculadora de Latência de Interrupção — Formula
## UART Baud Rate Generation
UART baud rate is derived from the peripheral clock using an integer divider and oversampling.
### Formula
**Divider = round(Clock / (Oversampling x Baud Rate))**
**Actual Baud = Clock / (Oversampling x Divider)**
**Error = |Actual - Desired| / Desired x 100%**
Baud rate error should stay below 2% for reliable communication. Errors above 3-5% cause framing errors, especially for multi-byte transfers.
UART baud rate is derived from the peripheral clock using an integer divider and oversampling.
### Formula
**Divider = round(Clock / (Oversampling x Baud Rate))**
**Actual Baud = Clock / (Oversampling x Divider)**
**Error = |Actual - Desired| / Desired x 100%**
Baud rate error should stay below 2% for reliable communication. Errors above 3-5% cause framing errors, especially for multi-byte transfers.
Exemplo Resolvido
16 MHz clock, 115200 baud, 16x oversampling.
- Exact divider: 16e6 / (16 x 115200) = 8.68
- Integer divider: round(8.68) = 9
- Actual baud: 16e6 / (16 x 9) = 111,111 baud
- Error: |111111 - 115200| / 115200 = 3.55%
- This is marginal; consider a different clock frequency