Pulse Width Modulator (PWM)
up from zero to the preset value, count back down to zero, and then repeat the process. This
will produce center-aligned PWM signals (that is, the middle of the high/low period of the PWM
signals produced by the generator will occur at the same time).
When the PWM generator parameters (period and pulse width) are modified, their affect on
the output PWM signals can be delayed. In synchronous mode, the parameter updates are not
applied until a synchronization event occurs. This allows multiple parameters to be modified
and take affect simultaneously, instead of one at a time. Additionally, parameters to multiple
PWM generators in synchronous mode can be updated simultaneously, allowing them to be
treated as if they were a unified generator. In non-synchronous mode, the parameter updates
are not delayed until a synchronization event. In either mode, the parameter updates only
occur when the counter is at zero to help prevent oddly formed PWM signals during the update
(that is, a PWM pulse that is too short or too long).
The PWM generator can either pause or continue running when the processor is stopped via
the debugger. If configured to pause, it will continue to count until it reaches zero, at which
point it will pause until the processor is restarted. If configured to continue running, it will keep
counting as if nothing had happened.
The ui32Config parameter contains the desired configuration. It is the logical OR of the follow-
ing:
PWM_GEN_MODE_DOWN or PWM_GEN_MODE_UP_DOWN to specify the counting
mode
PWM_GEN_MODE_SYNC or PWM_GEN_MODE_NO_SYNC to specify the counter load
and comparator update synchronization mode
PWM_GEN_MODE_DBG_RUN or PWM_GEN_MODE_DBG_STOP to specify the debug
behavior
PWM_GEN_MODE_GEN_NO_SYNC, PWM_GEN_MODE_GEN_SYNC_LOCAL, or
PWM_GEN_MODE_GEN_SYNC_GLOBAL to specify the update synchronization mode
for generator counting mode changes
PWM_GEN_MODE_DB_NO_SYNC, PWM_GEN_MODE_DB_SYNC_LOCAL, or
PWM_GEN_MODE_DB_SYNC_GLOBAL to specify the deadband parameter syn-
chronization mode
PWM_GEN_MODE_FAULT_LATCHED or PWM_GEN_MODE_FAULT_UNLATCHED to
specify whether fault conditions are latched or not
PWM_GEN_MODE_FAULT_MINPER or PWM_GEN_MODE_FAULT_NO_MINPER to
specify whether minimum fault period support is required
PWM_GEN_MODE_FAULT_EXT or PWM_GEN_MODE_FAULT_LEGACY to specify
whether extended fault source selection support is enabled or not
Setting PWM_GEN_MODE_FAULT_MINPER allows an application to set the minimum dura-
tion of a PWM fault signal. Faults will be signaled for at least this time even if the external fault
pin deasserts earlier. Care should be taken when using this mode since during the fault signal
period, the fault interrupt from the PWM generator will remain asserted. The fault interrupt
handler may, therefore, reenter immediately if it exits prior to expiration of the fault timer.
Note:
Changes to the counter mode will affect the period of the PWM signals produced.
ROM_PWMGenPeriodSet() and ROM_PWMPulseWidthSet() should be called after any
changes to the counter mode of a generator.
Returns:
None.
158 April 8, 2013