The signal monitoring unit has the
ability to monitor and check if a rise or fall edge occurs within a specified time
window and automatically generate an error when an edge occurs outside of this
window.
The time window of an expected edge event can be programmed using the following
configuration registers (or their respective shadow registers):
- MUNIT_#_MIN programs the minimum
pulse width capture value
- MUNIT_#_MAX programs the maximum
pulse with capture value
Any edge that occurs outside of these
programmed bounds triggers the following error event:
- MUNIT_#_ERROR_EVT1 generated when edge occurs outside the bounds of MUNIT_#_MIN
and MUNIT_#_MAX.
Additionally, ERROR_EVT2 is generated
if either MIN or MAX did not occur between two sync events.
The following diagram provides an
example in which a rising edge does not occur during the expected window, generating
an ERROR_EVT1 event.
Configuration Requirements
To enable this mode, the following
settings must be configured:
- The ECAP counter must be synced
with an EPWM module
- Absolute mode must be set for the
ECAP counter, so that the counter is free running and does not get reset on any
capture events
- Continuous mode can be enabled
(one-shot mode can be used, but is not recommended given the modes short
duration)
- A minimum of one capture can be
enabled (ECCTL2.STOP_WRAP >= 0, and at least CAP1 enabled)
- Capture Edge (ECCTL1.CAPxPOL) of
used capture modules (any of CAP1 to CAP4) must be configured to capture an edge
of interest
- The time window defined using MIN
and MAX can not cross the sync boundary
Note: The following are important
considerations when configuring the edge monitoring feature:
- If the EPWM counter or ECAP
counter are loaded with a non-zero phase value, the MIN and MAX values must
be adjusted accordingly in SW. This also applies when the glitch filter is
enabled, as the glitch filter delays the signal by QUALPRD+1
- The edge monitoring logic
restarts on a sync event. This is to avoid any deadlock in case MIN, MAX, or
both events do not occur between two sync events. ERROR_EVT2 is generated,
if MIN or MAX match did not occur between two sync events
- The time window defined using
MIN and MAX can not cross the sync boundary