Work out pwm resolution instantly with clear inputs, formula shown and shareable results.
PWM resolution is the timer clock divided by the PWM frequency, capped by the timer width. That is a hard trade: at 80 MHz a 20 kHz carrier gives 4,000 steps (about 12 bits), but pushing to 200 kHz leaves only 400 steps, under 9 bits.
PWM resolution
steps = timer clock / PWM frequency, capped at 2^bits; resolution in bits = log2(steps)
Each PWM period contains fewer timer ticks, and the tick count is the number of distinct duty cycles available.
Use a faster timer clock, a hardware high-resolution PWM peripheral, or dithering between adjacent duty values across successive cycles.