Pwm Waveform Details Of Apwm Mode Operation - Texas Instruments Concerto F28M35 Series Technical Reference Manual

Table of Contents

Advertisement

Application of the APWM Mode
8.8
Application of the APWM Mode
In this example, the eCAP module is configured to operate as a PWM generator. Here a very simple
single channel PWM waveform is generated from output pin APWMx. The PWM polarity is active high,
which means that the compare value (CAP2 reg is now a compare register) represents the on-time (high
level) of the period. Alternatively, if the APWMPOL bit is configured for active low, then the compare value
represents the off-time. Note here values are in hexadecimal ("h") notation.
8.8.1 Example 1 - Simple PWM Generation (Independent Channel/s)
Figure 8-27. PWM Waveform Details of APWM Mode Operation
FFFFFFFF
APRD
ACMP
0000000C
APWMx
(o/p pin)
Example 8-1. Code Snippet for APWM Mode
// Code snippet for APWM mode Example 1
// Initialization Time
//=======================
// ECAP module 1 config ECap1Regs.CAP1 = 0x1000;
// Set period value ECap1Regs.CTRPHS = 0x0;
// make phase zero ECap1Regs.ECCTL2.bit.CAP_APWM = EC_APWM_MODE;
ECap1Regs.ECCTL2.bit.APWMPOL = EC_ACTV_HI;
// Active high ECap1Regs.ECCTL2.bit.SYNCI_EN = EC_DISABLE;
// Synch not used ECap1Regs.ECCTL2.bit.SYNCO_SEL = EC_SYNCO_DIS;
// Synch not used ECap1Regs.ECCTL2.bit.TSCTRSTOP = EC_RUN;
// Allow TSCTR to run
// Run Time (Instant 1, for example, ISR call)
//======================
ECap1Regs.CAP2 = 0x300;
818
C28 Enhanced Capture (eCAP) Module
TSCTR
1000h
500h
300h
Off−time
On
time
Copyright © 2012–2019, Texas Instruments Incorporated
Period
SPRUH22I – April 2012 – Revised November 2019
Submit Documentation Feedback
www.ti.com

Advertisement

Table of Contents
loading

Table of Contents