Specifications
EPWM1A
V
OUT1
LPF
EPWM1A
CA
T
PWM
= 2.5 µs
Z
CA
ZZ
Operational Description of HRPWM
www.ti.com
Example 7. HRPWM Buck Converter Run-Time Code (continued)
MPYU ACC,T,@_hrbuck_period ; Q15 to Q0 scaling based on Period
MOV T,@_MEP_ScaleFactor ; MEP scale factor (from optimizer s/w)
MPYU P,T,@AL ; P <= T * AL, Optimizer scaling
MOVH @AL,P ; AL <= P, move result back to ACC
ADD ACC, #0x180 ; MEP range and rounding adjustment
MOVL *XAR3,ACC ; CMPA:CMPAHR(31:8) <= ACC
; Output for EPWM1B (Regular Res) Optional - for comparison purpose only
MOV *+XAR3[2],AH ; Store ACCH to regular CMPB
2.5.2 Implementing a DAC function Using an R+C Reconstruction Filter
In this example, the PWM requirements are:
• PWM frequency = 400 kHz (i.e., TBPRD = 250)
• PWM mode = Asymmetrical, Up-count
• Resolution = 14 bits ( MEP step size = 150 ps)
Figure 10 and Figure 11 show the DAC function and the required PWM waveform. As explained
previously, configuration for the ePWM1 module is almost identical to the normal case except that the
appropriate MEP options need to be enabled/selected.
Figure 10. Simple Reconstruction Filter for a PWM Based DAC
Figure 11. PWM Waveform Generated for the PWM DAC Function
The example code shown consists of two main parts:
• Initialization code (executed once)
• Run time code (typically executed within an ISR)
This example assumes a typical MEP_ScaleFactor and does not use the SFO library.
Example 8 shows the Initialization code. The first part is configured for conventional PWM. The second
part sets up the HRPWM resources.
26
High-Resolution Pulse Width Modulator (HRPWM) SPRU924F– April 2005– Revised October 2011
Submit Documentation Feedback
Copyright © 2005–2011, Texas Instruments Incorporated