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 #203 background imageLoading...
Page #203 background image
Lab 7: Control Peripherals
TMS320F2837xD Microcontroller Workshop - Control Peripherals 7 - 53
a frequency domain plot of the contents in the ADC results buffer (i.e. the PWM
waveform).
Click: Tools Graph FFT Magnitude and set the following values:
Acquisition Buffer Size 50
DSP Data Type 16-bit unsigned integer
Sampling Rate (Hz) 50000
Start Address AdcBuf
Data Plot Style Bar
FFT Order 10
Select OK to save the graph options.
12. On the plot window, hold the mouse left-click key and move the marker line to observe
the frequencies of the different magnitude peaks. Do the peaks occur at the expected
frequencies?
13. Fully halt the CPU (real-time mode) by using the Script function: Scripts
Realtime Emulation Control Full_Halt.
Setup eCAP1 to Measure Width of Pulse
The first part of this lab exercise generated a 2 kHz, 25% duty cycle symmetric PWM
waveform which was sampled with the on-chip analog-to-digital converter and displayed
using the graphing feature of Code Composer Studio. Next, eCAP1 will be setup to detect
the rising and falling edges of the waveform. This information will be used to determine the
period and duty cycle of the waveform. The results of this step will be viewed numerically in
a memory window and can be compared to the results obtained using the graphing features
of Code Composer Studio.
14. Add (copy) ECap.c to the project from C:\C28x\Labs\Lab7\source.
15. In Main_7.c, add code to call the InitECap()function. There are no passed
parameters or return values, so the call code is simply:
InitECap();
16. Edit Xbar.c and adjust the input selection register INPUT7SELECT for GPIO24 (header
J4, pin #34) to feed the eCAP1 function. Simply set the register to 24.
17. Open and inspect the eCAP1 interrupt service routine (ECAP1_INT_ISR) in the file
DefaultIsr_7.c. Notice that PwmDuty is calculated by CAP2 CAP1 (rising to falling
edge) and that PwmPeriod is calculated by CAP3 CAP1 (rising to rising edge).
18. In ECap.c, setup eCAP1 to calculate PWM_duty and PWM_period. The following
registers need to be modified: ECCTL2 (continuous mode, re-arm disable, and sync
disable), ECCTL1 (set prescale to divide-by-1, configure capture event polarity without
reseting the counter), and ECEINT (enable desired eCAP interrupt).
19. Using the “PIE Interrupt Assignment Table” find the location for the eCAP1 interrupt
ECAP1_INT” and fill in the following information:
PIE group #: # within group:

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