14.4.2.4.2 Triggering Modes
The PWM Generator provides two types of Triggering modes that determine how the SOC trigger is used. The Triggering modes are:
- Single Trigger mode (default)
- Retriggerable mode
The Trigger mode is selected using the TRGMOD[1:0] control bits (PGxCON[23:22]).
Single Trigger Mode
Single Trigger (Single Shot) mode is used when a PWM Generator timer
is started at the same time as (or a time that is offset from) another PWM Generator timer.
This mode is also useful for creating a single PWM pulse or creating a single delay based
on an external event. If a timer cycle is currently in progress, any incoming SOC trigger
pulses will be ignored. The entire timer cycle must complete before another SOC trigger can
restart the timer. Single Trigger mode is selected when TRGMOD[1:0] = 00
.
Retriggerable Mode
Retriggerable mode is different from Single Trigger mode in that a
PWM cycle may be restarted before the end of a cycle that is already in progress. If this
is done, the count will be reset when a new trigger is received and the current PWM cycle
stopped. This mode can be especially useful when a PWM Generator is synchronized to an
external, off-chip source that operates from a different clock source. The Retriggerable
mode is selected when TRGMOD[1:0] = 01
. The
TRGCNT[2:0] bits (PGxCON[10:8]) can be written to produce a multiple cycle PWM event.
If using a software trigger, TRSET, subsequent writes of TRSET should wait for the TRIG bit to clear, indicating that the request number of cycle is complete.