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.
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
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
- MIN and MAX are counter values (or number of clock cycles for a 200 MHz
system clock). For width monitoring, the pulse/period width is between MIN
and MAX no. of counter counts (or MIN*5 ns < pulse/period < MAX*5 ns).
For edge monitoring, the edge is expected to occur between counter values of
MIN and MAX after the sync (or MIN*5 ns < edge < MAX*5 ns, with
reference to sync).
The following diagram provides an example in which a rising edge does not occur
during the expected window, generating an ERROR_EVT1 event.