Enhanced Capture (eCAP) Module
Table 15-98. ECAP Initialization for CAP Mode Delta Time, Rising Edge Trigger
Register
Bit
Value
ECCTL1
CAP1POL
EC_RISING
ECCTL1
CAP2POL
EC_RISING
ECCTL1
CAP3POL
EC_RISING
ECCTL1
CAP4POL
EC_RISING
ECCTL1
CTRRST1
EC_DELTA_MODE
ECCTL1
CTRRST2
EC_DELTA_MODE
ECCTL1
CTRRST3
EC_DELTA_MODE
ECCTL1
CTRRST4
EC_DELTA_MODE
ECCTL1
CAPLDEN
EC_ENABLE
ECCTL1
PRESCALE
EC_DIV1
ECCTL2
CAP_APWM
EC_CAP_MODE
ECCTL2
CONT_ONESHT
EC_CONTINUOUS
ECCTL2
SYNCO_SEL
EC_SYNCO_DIS
ECCTL2
SYNCI_EN
EC_DISABLE
ECCTL2
TSCTRSTOP
EC_RUN
Example 15-11. Code Snippet for CAP Mode Delta Time, Rising Edge Trigger
// Code snippet for CAP mode Delta Time, Rising edge trigger
// Run Time ( e.g. CEVT1 triggered ISR call)
//==========================================
// Note: here Time-stamp directly represents the Period value.
Period4 = ECAPxRegs.CAP1;
// Fetch Time-Stamp captured at T1
Period1 = ECAPxRegs.CAP2;
// Fetch Time-Stamp captured at T2
Period2 = ECAPxRegs.CAP3;
// Fetch Time-Stamp captured at T3
Period3 = ECAPxRegs.CAP4;
// Fetch Time-Stamp captured at T4
1624
Pulse-Width Modulation Subsystem (PWMSS)
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated