Compute ARM PL011 UARTIBRD and UARTFBRD registers for RP2040
The Raspberry Pi RP2040 integrates two ARM PrimeCell PL011 UARTs clocked by default from the 125 MHz `clk_peri`. Its 6-bit fractional baud-rate register (`UARTFBRD`) divides in 1/64th steps, giving four times finer granularity than 4-bit fractional UARTs.
Enter any standard or custom baud rate (including DMX512 250 kbps or MIDI 31,250 bps) to read out exact `IBRD` and `FBRD` register values immediately.
Formulas
Divisor = 125,000,000 ÷ (16 × Baud)IBRD = floor(Divisor); FBRD = round((Divisor − IBRD) × 64)115,200 bps → Divisor = 67.8168 → IBRD = 67, FBRD = 52
Worked example
At 125 MHz and 115,200 bps, `IBRD = 67` and `FBRD = 52` yield 115,207.4 bps (+0.006% error). Even at 921,600 bps, error stays under 0.05%.