ISD91200 Series Technical Reference Manual
Release Date: Sep 16, 2019
- 176 -
Revision 2.4
5.7.5
PWM Double Buffering, Auto-reload and One-shot Operation
The I91200 series PWM Timers are double buffered, the reload value is updated at the start of next
period without affecting current timer operation. The PWM counter reset value can be written into
PWM_PERIOD0~1 and current PWM counter value can be read from PWM_CNT0~1.
The bit CNTMODEx in PWM Control Register (PWM_CTL) determines whether PWMx operates in
auto-reload or one-shot mode. If CNTMODEx is set to one, the auto-reload operation loads PERIODx
to PWM counter when PWM counter reaches zero. If PERIODx is set to zero, PWM counter will halt
when PWM counter counts to zero. If CNTMODEx is set as zero, counter will stop immediately.
PWM
Waveform
write a nonzero number to
prescaler & setup clock
dividor
Start
Write
CNR=150
CMR=50
151
51
200
50
Write
CNR=199
CMR=49
Write
CNR=99
CMR=0
100
1
Write
CNR=0
CMR=XX
Stop
Figure 5-28 PWM Double Buffering.
5.7.6
Modulate Duty Cycle
The double buffering allows CMP to be written at any point in current cycle. The loaded value will take
effect from next cycle. This is demonstrated in Figure 5-29 PWM Controller Duty Cycle Modulation
(PERIOD = 150).
Write
CMR=100
CNR=150
Write
CMR=50
Write
CMR=0
1 PWM cycle = 151
1 PWM cycle = 151
1 PWM cycle = 151
101
51
1
Figure 5-29 PWM Controller Duty Cycle Modulation (PERIOD = 150).