![Texas Instruments AM1808 Technical Reference Manual Download Page 448](http://html.mh-extra.com/html/texas-instruments/am1808/am1808_technical-reference-manual_1094558448.webp)
Applications
448
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
Enhanced Capture (eCAP) Module
Table 15-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 15-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 15-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 15-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