Figure 6.8-9 Pwm Down Counter Type - Nuvoton ISD94124BYI Technical Reference Manual

Isd arm cortex-m4f soc
Table of Contents

Advertisement

6.8.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 zero 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. The Figure 6.8-9 shows an example of down counter,
wherein
PWM period time = (PERIOD+1) * (CLKPSC+1) * PWM0_CLK.
CNT
(PWM_CNTn[15:0])
CNTENn
(PWM_CNTEN[n])
zero point event
period point event
Note: n denotes channel 0,1..5
6.8.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 zero to PERIOD and then starts counting down to zero 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 when the counter counts to PERIOD. The Figure 6.8-10 shows an example of
up-down counter, wherein
PWM period time =(PERIOD) * (CLKPSC+1) * PWM0_CLK.
The DIRF (PWM_CNTn[16]) bit is counter direction indicator flag, where high is up counting, and
low is down counting.
Sep 9, 2019
ISD94100 Series Technical Reference Manual
PERIOD = 5
PERIOD = 8
8
7
6
5
4
3
2
1
0
X
PWM Period
PWM Period

Figure 6.8-9 PWM Down Counter Type

Page 410 of 928
PERIOD = 8
8
7
6
5
5
4
4
3
3
2
1
0
PWM Period
8
7
6
2
1
0
Rev1.09

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents