Capture Sequence For Absolute Time-Stamp And Rising Edge Detect - Texas Instruments Concerto F28M35 Series Technical Reference Manual

Table of Contents

Advertisement

Application of the ECAP Module
// CAPxPOL bits
// CTRRSTx bits
// PRESCALE bits
// ECCTL2 ( ECAP Control Reg 2)
//==========================
// CONT/ONESHOT bit
// STOPVALUE bit
// RE-ARM bit #define EC_ARM 0x1
// TSCTRSTOP bit
// SYNCO_SEL bit
// CAP/APWM mode bit #define EC_CAP_MODE 0x0
// APWMPOL bit
// Generic
8.7.1 Example 1 - Absolute Time-Stamp Operation Rising Edge Trigger
Figure 8-23
shows an example of continuous capture operation (Mod4 counter wraps around). In this
figure, TSCTR counts-up without resetting and capture events are qualified on the rising edge only, this
gives period (and frequency) information.
On an event, the TSCTR contents (time-stamp) is first captured, then Mod4 counter is incremented to the
next state. When the TSCTR reaches FFFFFFFF (maximum value), it wraps around to 00000000 (not
shown in
Figure
8-23), if this occurs, the CTROVF (counter overflow) flag is set, and an interrupt (if
enabled) occurs, CTROVF (counter overflow) Flag is set, and an Interrupt (if enabled) occurs. Captured
Time-stamps are valid at the point indicated by the diagram (after the 4th event), hence event CEVT4 can
conveniently be used to trigger an interrupt and the CPU can read data from the CAPx registers.
Figure 8-23. Capture Sequence for Absolute Time-stamp and Rising Edge Detect
CEVT1
CAPx pin
FFFFFFFF
CTR[0−31]
00000000
MOD4
0
CTR
CAP1
XX
CAP2
CAP3
CAP4
Polarity selection
810
C28 Enhanced Capture (eCAP) Module
#define EC_RISING 0x0
#define EC_ABS_MODE 0x0
#define EC_BYPASS 0x0
#define EC_CONTINUOUS 0x0 #define EC_ONESHOT 0x1
#define EC_EVENT1 0x0
#define EC_FREEZE 0x0
#define EC_SYNCIN 0x0
#define EC_ACTV_HI 0x0
#define EC_DISABLE 0x0
CEVT2
t
2
t
1
1
XX
XX
Capture registers [1−4]
Copyright © 2012–2019, Texas Instruments Incorporated
#define EC_FALLING 0x1
#define EC_DELTA_MODE 0x1
#define EC_DIV1 0x0 #define EC_DIV2 0x1
#define EC_DIV4 0x2 #define EC_DIV6 0x3
#define EC_DIV8 0x4 #define EC_DIV10 0x5
#define EC_EVENT2 0x1 #define EC_EVENT3 0x2
#define EC_EVENT4 0x3
#define EC_RUN 0x1
#define EC_CTR_PRD 0x1
#define EC_SYNCO_DIS 0x2
#define EC_APWM_MODE 0x1
#define EC_ACTV_LO 0x1
#define EC_ENABLE 0x1 #define EC_FORCE 0x1
CEVT3
t
3
2
t
1
XX
All capture values valid
(can be read) at this time
SPRUH22I – April 2012 – Revised November 2019
www.ti.com
CEVT4
CEVT1
t
5
t
4
3
0
1
t
5
t
2
t
3
t
4
Submit Documentation Feedback
t

Advertisement

Table of Contents
loading

Table of Contents