Functional Description
1442
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Pulse Width Modulator (PWM)
•
Immediately
–
The write value has immediate effect, and the hardware reacts immediately.
•
Locally Synchronized
–
The write value does not affect the logic until the counter reaches the value zero at the end of the
PWM cycle. In this case, the effect of the write is deferred, providing a guaranteed defined behavior
and preventing overly short or overly long output PWM pulses.
•
Globally Synchronized
–
The write value does not affect the logic until two sequential events have occurred:
1. The Update mode for the generator function is programmed for global synchronization in the
PWMnCTL register
2. The counter reaches zero at the end of the PWM cycle. In this case, the effect of the write is
deferred until the end of the PWM cycle following the end of all updates. This mode allows
multiple items in multiple PWM generators to be updated simultaneously without odd effects
during the update; everything runs from the old values until a point at which they all run from the
new values. The Update mode of the load and comparator match values can be individually
configured in each PWM generator block. It typically makes sense to use the synchronous
update mechanism across PWM generator blocks when the timers in those blocks are
synchronized, although this is not required for this mechanism to function properly.
The following registers provide either local or global synchronization based on the state of various Update
mode bits and fields in the PWMnCTL register (LOADUPD, CMPAUPD, and CMPBUPD):
•
Generator Registers: PWMnLOAD, PWMnCMPA, and PWMnCMPB
The following registers default to immediate update, but are provided with the optional functionality of
synchronously updating rather than having all updates take immediate effect:
•
Module-Level Register: PWMENABLE (based on the state of the ENUPDn bits in the PWMENUPD
register).
•
Generator Register: PWMnGENA, PWMnGENB, PWMnDBCTL, PWMnDBRISE, and PWMnDBFALL
(based on the state of various Update mode bits and fields in the PWMnCTL register [GENAUPD,
GENBUPD, DBCTLUPD, DBRISEUPD, and DBFALLUPD]).
All other registers are considered statically provisioned for the execution of an application or are used
dynamically for purposes unrelated to maintaining synchronization and therefore do not need synchronous
update functionality.
21.3.8 Fault Conditions
A fault condition is one in which the controller must be signaled to stop normal PWM function and then set
the MnPWMn signals to a safe state. Two basic situations cause fault conditions:
•
The microcontroller is stalled and cannot perform the necessary computation in the time required for
motion control
•
An external error or event is detected
The PWM generator can use the following inputs to generate a fault condition, including:
•
MnFAULTn pin assertion
•
A stall of the controller generated by the debugger
•
The trigger of an ADC digital comparator
Fault conditions are calculated on a per-PWM generator basis. Each PWM generator configures the
necessary conditions to indicate a fault condition exists. This method allows the development of
applications with dependent and independent control.
Four fault input pins (MnFAULTn) are available. These inputs may be used with circuits that generate an
active High or active Low signal to indicate an error condition. A MnFAULTn pins may be individually
programmed for the appropriate logic sense using the PWMnFLTSEN register.