How it works
| Timer | Frequency | Notes |
|---|---|---|
| STM32 TIMx, edge-aligned | f = fclk / ((PSC + 1)(ARR + 1)) | duty = CCR / (ARR + 1) |
| STM32 TIMx, center-aligned | f = fclk / (2 (PSC + 1) ARR) | symmetric PWM for motor control |
| AVR Timer1, fast PWM (mode 14) | f = F / (N (1 + ICR1)) | N ∈ {1, 8, 64, 256, 1024} |
| RP2040 / RP2350 slice | f = clk_sys / (DIV × (TOP + 1)) | DIV = INT + FRAC/16, phase-correct halves f |
The search prefers the smallest prescaler that reaches the frequency exactly, which gives the largest period and so the finest duty-cycle resolution. The result shows how many duty steps you get and the equivalent bits.
Which clock?
On STM32, the timer clock is the APB clock, doubled when the APB prescaler isn’t 1. On the N6 and H7 it can also come from a dedicated kernel clock. Read the exact value from CubeMX’s clock tree; the presets are examples.