
DocID13284 Rev 2
351/564
UM0404
Pulse width modulation module
Figure 149. Operation and output waveform in single shot mode
After starting the timer (with PTRx = ‘1’) the output pulse may be modified via software.
Writing to timer PTx changes the positive and/or negative edge of the output signal,
depending on whether the pulse has already started (the output is high) or not (the output is
still low). This (multiple) re-triggering is always possible while the timer is running, after the
pulse has started and before the timer is stopped.
Loading counter PTx directly with the value in the respective PPx shadow register will abort
the current PWM pulse upon the next clock pulse (counter is cleared and stopped by
hardware).
By setting the period (PPx), the timer start value (PTx) and the pulse width value (PWx)
appropriately, the pulse width (tw) and the optional pulse delay (td) may be varied in a wide
range (see
).
17.2
PWM module registers
The PWM module is controlled via two sets of registers. The waveforms are selected by the
channel specific registers PTx (timer), PPx (period) and PWx (pulse width). Three common
registers control the operating modes and the general functions (PWMCON0 and
PWMCON1) of the PWM module as well as the interrupt behavior (PWMIC).
7
6
5
3
4
2
1
0
PPx
Period=7
PTx Count
Value
PWx Pulse
Width=4
Set PTRx
by Software
PTRx Reset
by Hardware
PTx stopped
7
6
5
3
4
2
1
0
Set PTRx
by Software
LSR
for Next Pulse
6
5
3
4
2
1
0
PPx
Period=7
PTx Count
Value
PWx Pulse
Width=4
7
6
5
4
t
D
Retrigger after
Write PWx value to PTx
1
0
7
6
5
4
t
D
Trigger before Pulse has started :
Write PWx value to PTx;
LSR
t
W
t
W
Shortens Delay Time t
D
Pulse has started :