Figure 6.8-7 Pwm0 Counter Waveform When Set Clear Counter; Figure 6.8-8 Pwm Up Counter Type - Nuvoton ISD94124BYI Technical Reference Manual

Isd arm cortex-m4f soc
Table of Contents

Advertisement

6.8.5.2
PWM Counter
PWM supports 3 counter types operation: Up Counter, Down Counter and Up-Down Counter types.
For PWM channel0, CNT(PWM_CNT0[15:0]) can clear to 0x00 by CNTCLR0 (PWM_CNTCLR[0]).
CNT will be cleared when prescale counter to 0, and CNTCLR will be set 0 by hardware
automatically.
PCLK
PWM0_CLK
CNTCLR0
(PWM_CNTCLR[0])
CNTEN0
(PWM_CNTEN[0])
Prescale counter
CNT
(PWM_CNT0[15:0])

Figure 6.8-7 PWM0 Counter Waveform when set clear counter

6.8.5.3
Up Counter Type
When PWM counter is set to up counter type, CNTTYPEn (PWM_CTL1[2n+1:2n], n = 0,1..5) is
0x0, it starts up-counting from zero to PERIOD (PWM_PERIODn[15:0], where n denotes channel
number) 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-8 shows an example of up 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
Sep 9, 2019
ISD94100 Series Technical Reference Manual
0
4
3 2 1 0
4 3 2 1 0
x
0
PERIOD = 5
PERIOD = 8
5
4
3
3
2
2
1
1
X
0
0
PWM Period
PWM Period

Figure 6.8-8 PWM Up Counter Type

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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents