Texas Instruments TMS320F2837 D Series Workshop Manual And Lab Manual page 203

Hide thumbs Also See for TMS320F2837 D Series:
Table of Contents

Advertisement

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:
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:
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 #:
TMS320F2837xD Microcontroller Workshop - Control Peripherals
Acquisition Buffer Size
DSP Data Type
Sampling Rate (Hz)
Start Address
Data Plot Style
FFT Order
InitECap();
# within group:
Lab 7: Control Peripherals
50
16-bit unsigned integer
50000
AdcBuf
Bar
10
7 - 53

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Table of Contents

Save PDF