Figure 6.7-15 Pwm Down Count Type; Figure 6.7-16 Pwm Up-Down Count Type - Nuvoton ISD94124BYI Technical Reference Manual

Isd arm cortex-m4f soc
Table of Contents

Advertisement

PWMCNT
(TIMERx_PWMCNT[15:0])
PWMCNTEN
(TIMERx_PWMCTL[0])
zero point event
period point event
6.7.6.5
Up-Down Count Type
When 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.7-16 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.
PWMCNT
(TIMERx_PWMCNT[15:0])
PWMDIRF
(TIMERx_PWMCNT[16])
PWMCNTEN
(TIMERx_PWMCTL[0])
zero point event
center point event
Note: When in up-down count type, period interrupt flag occurs at center point event.
Sep 9, 2019
ISD94100 Series Technical Reference Manual
PERIOD = 5
PERIOD = 8
8
7
6
5
4
3
2
1
0
PWM Period
PWM Period

Figure 6.7-15 PWM Down Count Type

PERIOD = 4
4
3
3
2
2
1
1
1
0
0
PWM Period

Figure 6.7-16 PWM Up-Down Count Type

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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents