
M0A21/M0A23 Series
May 06, 2022
Page
345
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
0
1
2
3
4
5
0
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
7
8
0
1
2
PWM Period
PWM Period
PERIOD = 5
PERIOD = 8
PWM Period
PERIOD = 8
zero point event
period point event
CNT
(PWM_CNTn[15:0])
CNTENn
(PWM_CNTEN[n])
X
Note:
n denotes channel 0,1..5
Figure 6.10-8 PWM Up Counter Type
6.10.5.4 Down Counter Type
When PWM counter is set to down counter type, CNTTYPEn (PWM_CTL1[2n+1:2n], n = 0,1..5) is 0x1,
it starts down-counting from PERIOD to 0 to complete a PWM period. The current counter value can be
read from CNT (PWM_CNTn[15:0]) bits. PWM generates zero point event when the counter counts to
0 and prescale counts to 0. PWM generates period point event when the counter counts to PERIOD
and prescale counts to 0. Figure 6.10-9 shows an example of down counter, wherein
PWM period time = (1) * (1) * PWMx_CLK.
0
1
2
3
4
X
0
1
2
3
4
5
6
7
8
0
1
2
3
4
5
6
7
8
6
7
8
PWM Period
PWM Period
PWM Period
PERIOD = 5
PERIOD = 8
PERIOD = 8
zero point event
period point event
CNT
(PWM_CNTn[15:0])
CNTENn
(PWM_CNTEN[n])
5
Note:
n denotes channel 0,1..5
Figure 6.10-9 PWM Down Counter Type
6.10.5.5 Up-Down Counter Type
When PWM counter is set to up-down count type, CNTTYPEn (PWM_CTL1[2n+1:2n], n = 0,1..5) is 0x2,
it starts counting-up from 0 to PERIOD and then starts counting down to 0 to complete a PWM period.
The current counter value can be read from CNT (PWM_CNTn[15:0]) bits. PWM generates zero point
event when the counter counts to 0 and prescale counts to 0. PWM generates center point event which
is equal to period point event when the counter counts to PERIOD. Figure 6.10-10 shows an example
of up-down counter, wherein