EasyManuals Logo

Texas Instruments TMS320F2837 D Series Workshop Guide And Lab Manual

Texas Instruments TMS320F2837 D Series
324 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 #205 background imageLoading...
Page #205 background image
Lab 7: Control Peripherals
TMS320F2837xD Microcontroller Workshop - Control Peripherals 7 - 55
Optional Exercise – Modulate the PWM Waveform
If you finish early, you might want to experiment with the code by observing the effects of
changing the ePWM1 CMPA register using real-time emulation. Be sure that the jumper wire is
connecting PWM1A (header J4, pin #40) to ADCINA0 (header J3, pin #30), and the Single Time
graph is displayed. The graph must be enabled for continuous refresh.
a) Run the code in real-time mode.
b) Open an Expressions window to the EPwm1Regs.CMPA register – in EPwm.c highlight
the “EPwm1Regs” structure and right click, then select Add Watch Expression… and
then OK.
c) In the Expressions window open “EPwm1Regs”, then open “CMPA” and open “bit”.
d) The Expressions window must be enabled for continuous refresh.
e) Under “bit” change the “CMPA” 18750 value (within a range of 2500 and 22500).
f) Notice the effect on the PWM waveform in the graph.
You have just modulated the PWM waveform by manually changing the CMPA value. Next, we
will modulate the PWM automatically by having the ADC ISR change the CMPA value.
a) In DefaultIsr_7.c notice the code in the ADCA1 interrupt service routine used to modulate
the PWM1A output between 10% and 90% duty cycle.
b) In Main.c add “PWM_MODULATE” to the Expressions window using the same procedure
above.
c) Then with the code running in real-time mode, change the “PWM_MODULATE” from 0 to
1 and observe the PWM waveform in the graph. Also, in the Expressions window notice
the CMPA value being updated.
(If you do not have time to work on this optional exercise, you may want to try this later).
Terminate Debug Session and Close Project
27. Terminate the active debug session using the Terminate button. This will close the
debugger and return Code Composer Studio to the CCS Edit perspective view.
28. Next, close the project by right-clicking on Lab7 in the Project Explorer window and
select Close Project.
End of Exercise

Table of Contents

Other manuals for Texas Instruments TMS320F2837 D Series

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments TMS320F2837 D Series Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320F2837 D Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals