Lab 7: Control Peripherals
C2000 Microcontroller Workshop - Control Peripherals 7 - 45
Lab 7: Control Peripherals
Objective
The objective of this lab is to become familiar with the programming and operation of the control
peripherals and their interrupts. ePWM1A will be setup to generate a 2 kHz, 25% duty cycle
symmetric PWM waveform. The waveform will then be 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 width of the pulse and duty cycle of the waveform. The results of this
step will be viewed numerically in a memory window.
Lab 7: Control Peripherals
ADC
RESULT0
...
data
memory
CPU copies
result to
buffer during
ADC ISR
ePWM2
connector
wire
Capture 1 Register
ADC-
INA0
TB Counter
Compare
Action Qualifier
ePWM1
eCAP1
Capture 2 Register
Capture 3 Register
Capture 4 Register
View ADC
buffer PWM
Samples
Code Composer
Studio
ePWM2 triggering
ADC on period match
using SOCA trigger every
20 µs (50 kHz)
Procedure
Open the Project
1. A project named Lab7 has been created for this lab. Open the project by clicking on
Project Import CCS Projects. The “Import CCS Eclipse Projects”
window will open then click Browse… next to the “Select search-directory” box.
Navigate to: C:\C28x\Labs\Lab7\Project and click OK. Then click Finish to
import the project. All build options have been configured the same as the previous lab.
The files used in this lab are: