2014-11-05 02:58 AM
Hi,
Consider this situation:TimerX is counting down from 1000 to 0 and it will up-count from 0 to 1000 afterwards (center aligned PWM).If I set a CC to something like 200, and enabled CC interrupt, the interrupt would happen when the timer was upcounting from 0 to 1000 and it crosses 200. But... I want an interrupt while it's down counting, in other words, when it's going from 201 to 200. Not when it's counting up from 199 to 200.Is there any solutions?Thanks2015-05-07 04:37 AM
I think there are three different center aligned strategies:
The Output compare interrupt flag of channels configured in output is set when: thecounter counts down (Center aligned mode 1, CMS = ''01''), the counter counts up (Center aligned mode 2, CMS = ''10'') the counter counts up and down (Center aligned mode 3,CMS = ''11'').