English
Language : 

M0564LE4AE Datasheet, PDF (109/161 Pages) List of Unclassifed Manufacturers – 32-BIT MICROCONTROLLER
M0564
6.17.3.4 Down Count Type
When the PWM counter is set to down count type, CNTTYPE (TIMERx_PWMCTL[2:1]) is 0x1, it
starts down-counting from PERIOD to zero, current counter value can be read from CNT
(TIMERx_PWMCNT[15:0]). PWM generates a zero point event when both counter and prescale
counts to 0. PWM generates a period point event when the counter counts to PERIOD and
prescale counts to 0. Figure 6.17-3 is an example of PWM down count type, where PWM period
time is (PERIOD+1) * (CLKPSC+1) * TMRx_PWMCLK.
CNT
(TIMERx_PWMCNT[15:0])
CNTEN
(TIMERx_PWMCTL[0])
zero point event
period point event
PERIOD = 5
PERIOD = 8
PERIOD = 8
543210876543210876543210876
PWM Period
PWM Period
PWM Period
Figure 6.17-3 PWM Down Count Type
6.17.3.5 Up-Down Count Type
When the PWM counter is set to up-down count type, CNTTYPE (TIMERx_PWMCTL[2:1]) is 0x2,
it starts counting up from zero to PERIOD and then starts counting down to zero. The current
counter value can be read from CNT (TIMERx_PWMCNT[15:0]). PWM generates a zero point
event when both counter and prescale counts to 0. PWM generates a center point event when the
counter counts to PERIOD and prescale counts to 0. Figure 6.17-4 shows an example of PWM
up-down count type, where PWM period time is (2 * PERIOD) * (CLKPSC+1) * TMRx_PWMCLK.
The DIRF (TIMERx_PWMCNT[16]) is counter direction indicator flag, where 1 is up counting, and
0 is down counting.
May 05, 2017
Page 109 of 161
Rev 1.00