2022-01-16 10:23 PM
hey there
I have a project where I need to control light of a LED and dim it. usually we use TIMER PWM GENERATION. for example in CubeMX I set a pin to TIMx CHy and by choosing "PWM Generating CHy" I can easily control LED light using PWM signal.
but in my case this LED pin has no TIM Channel connected to it. what should I do to dim the LED?
2022-01-17 08:48 AM
You may use 2 channel DMA to GPIO BSRR triggered by timer update and compare; set on update, reset on compare. The only quirk is to prevent outputting active level at timer update when duty is equal to 0.