ISD91200 Series Technical Reference Manual
Release Date: Sep 16, 2019
- 175 -
Revision 2.4
CMP < PERIOD: PWM low width= (PERIOD-CMP) unit
1
; PWM high width=(CMP+1) unit.
CMP = 0: PWM low width = (PERIOD) unit; PWM high width=1 unit
Note: 1. Unit = one PWM clock cycle.
+
-
CMRx+1
CNRx
PWM-Timer
Comparator
Output
CNRx
CMRx
Update
new CMRx
Start
Initialize
PWM
PWM
Ouput
CMR+1
CNR+1
Note: x= 0~1.
Figure 5-26 PWM Generation Timing
The procedure to operate the PWM generator is shown in Figure 5-27 PWM-Timer Operation Timing.
First initialize the PWM settings. At the same time ensure that GPIO are configured to PWM function.
Next step is to enable PWM channel. After this, if PERIOD or CMP register is written by software, it is
double buffered until the next counter reload, at which time the registers are updated to new values.
Comparator
(CMR)
1
0
PWM
down-counter
3
3
2
1
0
4
3
2
1
0
4
PWM-Timer
output
1
CMR = 1
CNR = 3
Auto reload = 1
(CHxMOD=1)
Set ChxEN=1
(PWM-Timer starts running)
CMR = 0
CNR = 4
Auto-load
(S/W write new value)
Auto-load
(Write initial setting)
(H/W update value)
(PWMIFx is set by H/W)
(PWMIFx is set by H/W)
Figure 5-27 PWM-Timer Operation Timing