They trade off because the same ARR value sets both. The number of distinct duty steps is ARR+1 (duty resolution = 1/(ARR+1)), and the frequency is f_clk/((PSC+1)(ARR+1)). From a fixed timer clock, raising the PWM frequency requires lowering ARR (fewer counter ticks per period), which directly reduces the number of duty steps. For example, at 72 MHz an ARR of 7199 gives 10 kHz with ~7200 steps (almost 13-bit resolution), while an ARR of 71 gives 1 MHz with only 72 steps (~6-bit). So you cannot independently maximize both frequency and resolution from a given clock, you pick the frequency the load demands (above flicker/audible thresholds, below switching-loss limits) and accept the resulting resolution, or you raise the timer clock to buy back steps. This matters when, say, you need both high-frequency motor drive and fine speed control and discover the resolution is too coarse.
Embedded Systems Fundamentals · Interview question
What's the tradeoff between PWM frequency and duty-cycle resolution?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
PWM
Fake an analog level with a digital pin: a fixed-frequency square wave whose duty cycle sets the average voltage, built on a timer and used for LEDs, motors, and servos.
More PWM questions
What is PWM and how does it produce an "analog" output from a digital pin?How is PWM generated using a timer?Why can't you drive a motor directly from a PWM-capable GPIO pin?How does PWM control a hobby servo, and how is that different from LED dimming?What is dead-time in a complementary PWM pair, and why does an H-bridge need it?Your PWM-controlled LED looks steady to the eye but flickers badly on camera video. What's going on and how do you fix it?
Browse all 472 interview questions