EasyManuals Logo
Home>Texas Instruments>Controller>TMS320 2833 Series

Texas Instruments TMS320 2833 Series User Manual

Texas Instruments TMS320 2833 Series
868 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #370 background imageLoading...
Page #370 background image
Application of the APWM Mode
www.ti.com
370
SPRUI07March 2020
Submit Documentation Feedback
Copyright © 2020, Texas Instruments Incorporated
Enhanced Capture (eCAP)
Example 5-1. Code Snippet for APWM Mode
// Code snippet for APWM mode Example 2
// Initialization Time
//=======================
// ECAP module 1 config
ECap1Regs.ECCTL2.bit.CAP_APWM = EC_APWM_MODE;
ECap1Regs.CAP1 = 1200; // Set period value
ECap1Regs.CTRPHS = 0; // make eCAP1 reference phase = zero
ECap1Regs.ECCTL2.bit.APWMPOL = EC_ACTV_HI;
ECap1Regs.ECCTL2.bit.SYNCI_EN = EC_DISABLE; // No sync in for Master
ECap1Regs.ECCTL2.bit.SYNCO_SEL = EC_CTR_PRD; // eCAP1 is Master
ECap1Regs.ECCTL2.bit.TSCTRSTOP = EC_RUN; // Allow TSCTR to run
// ECAP module 2 config
ECap2Regs.CAP1 = 1200; // Set period value
ECap2Regs.CTRPHS = 800; // Phase offset = 1200-400 = 120 deg
ECap2Regs.ECCTL2.bit.CAP_APWM = EC_APWM_MODE;
ECap2Regs.ECCTL2.bit.APWMPOL = EC_ACTV_HI;
ECap2Regs.ECCTL2.bit.SYNCI_EN = EC_ENABLE; // slaved off master
ECap2Regs.ECCTL2.bit.SYNCO_SEL = EC_SYNCI; // sync "flow-through"
ECap2Regs.ECCTL2.bit.TSCTRSTOP = EC_RUN; // Allow TSCTR to run
// ECAP module 3 config
ECap3Regs.CAP1 = 1200; // Set period value
ECap3Regs.CTRPHS = 400; // Phase offset = 1200-800 = 240 deg
ECap3Regs.ECCTL2.bit.CAP_APWM = EC_APWM_MODE;
ECap3Regs.ECCTL2.bit.APWMPOL = EC_ACTV_HI;
ECap3Regs.ECCTL2.bit.SYNCI_EN = EC_ENABLE; // slaved off master
ECap3Regs.ECCTL2.bit.SYNCO_SEL = EC_SYNCO_DIS; // "break the chain"
ECap3Regs.ECCTL2.bit.TSCTRSTOP = EC_RUN; // Allow TSCTR to run
// 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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 2833 Series and is the answer not in the manual?

Texas Instruments TMS320 2833 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320 2833 Series
CategoryController
LanguageEnglish

Related product manuals