Maintaining a Stable PWM Frequency When Changing LED Brightness on STM32
When using an STM32 timer to control LED brightness, is it generally better to keep the timer period fixed and adjust the compare value, rather than changing the timer period as well?
My understanding is that changing the compare value allows the duty cycle to vary while keeping the PWM frequency constant. Are there any practical considerations when selecting the timer prescaler and auto-reload value, particularly when aiming for smooth dimming across the full brightness range?
I’d appreciate any guidance on the timer configuration and potential trade-offs.
