English
Language : 

M0564LE4AE Datasheet, PDF (108/161 Pages) List of Unclassifed Manufacturers – 32-BIT MICROCONTROLLER
M0564
6.17.3 PWM Functional Description
6.17.3.1 PWM Prescale
The PWM prescale is used to divide clock source, and the clock of PWM counter is divided by
(CLKPSC+ 1). The prescale is set by CLKPSC (TIMERx_PWMCLKPSC[11:0]). Figure 6.17-1
shows an example of PWM prescale waveform in up count type.
TMRx_PWMCLK
CLKPSC
(TIMERx_PWMCLKPSC[11:0])
4
6
CNTEN
(TIMERx_PWMCTL[0])
Prescale counter
CNT
(TIMERx_PWMCNT[15:0])
0 4321043210432104321065432106
x
0
1
2
3
4
Figure 6.17-1 PWM Prescale Waveform in Up Count Type
6.17.3.2 PWM Counter
PWM supports three counter types operation: up count, down count and up-down count types.
6.17.3.3 Up Count Type
When the PWM counter is set to up count type, CNTTYPE (TIMERx_PWMCTL[2:1]) is 0x0, it
starts up-counting from zero to PERIOD (TIMERx_PWMPERIOD[15:0]). The current counter
value can be read from the 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-2 shows an example of PWM up
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
012345012345678012345678012
PWM Period
PWM Period
PWM Period
Figure 6.17-2 PWM Up Count Type
May 05, 2017
Page 108 of 161
Rev 1.00