Applications
269
SPRUH91D – March 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Enhanced Capture (eCAP) Module
Table 13-10. ECAP1 Initialization for Multichannel PWM Generation with Phase Control
Register
Bit
Value
CAP1
CAP1
1200
CTRPHS
CTRPHS
0
ECCTL2
CAP_APWM
EC_APWM_MODE
ECCTL2
APWMPOL
EC_ACTV_HI
ECCTL2
SYNCI_EN
EC_DISABLE
ECCTL2
SYNCO_SEL
EC_CTR_PRD
ECCTL2
TSCTRSTOP
EC_RUN
Table 13-11. ECAP2 Initialization for Multichannel PWM Generation with Phase Control
Register
Bit
Value
CAP1
CAP1
1200
CTRPHS
CTRPHS
800
ECCTL2
CAP_APWM
EC_APWM_MODE
ECCTL2
APWMPOL
EC_ACTV_HI
ECCTL2
SYNCI_EN
EC_ENABLE
ECCTL2
SYNCO_SEL
EC_SYNCI
ECCTL2
TSCTRSTOP
EC_RUN
Table 13-12. ECAP3 Initialization for Multichannel PWM Generation with Phase Control
Register
Bit
Value
CAP1
CAP1
1200
CTRPHS
CTRPHS
400
ECCTL2
CAP_APWM
EC_APWM_MODE
ECCTL2
APWMPOL
EC_ACTV_HI
ECCTL2
SYNCI_EN
EC_ENABLE
ECCTL2
SYNCO_SEL
EC_SYNCO_DIS
ECCTL2
TSCTRSTOP
EC_RUN
Example 13-7. Code Snippet for Multichannel PWM Generation with Phase Control
// Code snippet for APWM mode Example 3
// Run Time (Note: Example execution of one run-time instant)
//============================================================
// All phases are set to the same duty cycle
ECAP1Regs.CAP2 = 700;
// Set Duty cycle i.e. compare value = 700
ECAP2Regs.CAP2 = 700;
// Set Duty cycle i.e. compare value = 700
ECAP3Regs.CAP2 = 700;
// Set Duty cycle i.e. compare value = 700