Page 1 of 1

PWM cycles counting

Posted: Wed Jul 23, 2025 3:13 pm
by orij
hi
i created PWM cycle ( set duty cycle from 0 to 255 and back to 0 ) .( for led dimmig effact )
i want this efact to work for 5 times. ( 5 cycles )
any idea how to do this?
thanks.

Re: PWM cycles counting

Posted: Wed Jul 23, 2025 3:22 pm
by BenR
Hello,

The PWM should be driven by a timer, just enable a timer interrupt for that timer before you enable the PWM and this should give you an interrupt at the end of every period. Hope this helps.