Registers
455
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Enhanced Capture (eCAP) Module
Table 15-21. ECAP Control Register 2 (ECCTL2) Field Descriptions (continued)
Bit
Field
Value
Description
3
RE-ARM
One-Shot Re-Arming Control, that is, wait for stop trigger. Note: The re-arm function is valid in one
shot or continuous mode.
0
Has no effect (reading always returns a 0)
1
Arms the one-shot sequence as follows:
1) Resets the Mod4 counter to zero
2) Unfreezes the Mod4 counter
3) Enables capture register loads
2-1
STOP_WRAP
0-3h
Stop value for one-shot mode. This is the number (between 1-4) of captures allowed to occur
before the CAP(1-4) registers are frozen, that is, capture sequence is stopped.
Wrap value for continuous mode. This is the number (between 1-4) of the capture register in which
the circular buffer wraps around and starts again.
0
Stop after Capture Event 1 in one-shot mode.
Wrap after Capture Event 1 in continuous mode.
1h
Stop after Capture Event 2 in one-shot mode.
Wrap after Capture Event 2 in continuous mode.
2h
Stop after Capture Event 3 in one-shot mode.
Wrap after Capture Event 3 in continuous mode.
3h
Stop after Capture Event 4 in one-shot mode.
Wrap after Capture Event 4 in continuous mode.
Notes: STOP_WRAP is compared to Mod4 counter and, when equal, 2 actions occur:
• Mod4 counter is stopped (frozen)
• Capture register loads are inhibited
In one-shot mode, further interrupt events are blocked until re-armed.
0
CONT/ONESHT
Continuous or one-shot mode control (applicable only in capture mode)
0
Operate in continuous mode
1
Operate in one-shot mode
15.4.9 ECAP Interrupt Enable Register (ECEINT)
The ECAP interrupt enable register (ECEINT) is shown in
and described in
.
The interrupt enable bits (CEVT
n
) block any of the selected events from generating an interrupt. Events
will still be latched into the flag bit (ECFLG register) and can be forced/cleared via the ECFRC/ECCLR
registers.
The proper procedure for configuring peripheral modes and interrupts is:
1. Disable global interrupts
2. Stop eCAP counter
3. Disable eCAP interrupts
4. Configure peripheral registers
5. Clear spurious eCAP interrupt flags
6. Enable eCAP interrupts
7. Start eCAP counter
8. Enable global interrupts