Lab 7: Event Manager
13. Fully halt the DSP (real-time mode) by using Debug Halt and then unchecking the
“Real-time mode”.
Setup Capture Unit 1 to Measure Width of Pulse
14. Edit Gpio.c and adjust the shared I/O pins in Group A for the CAP1 function.
15. In
Ev_7_8_9_10.c, setup Capture Unit 1 to use Timer 1 as the time base. Configure
to detect both rising and falling edges. (Hint – when configuring the CAPCONA register,
set bit 15 to 0).
16. Using the “PIE Interrupt Assignment Table” find the location for the CAP1
interrupt,
“CAPINT1” and fill in the following information:
PIE group #:
# within group:
This information will be used in the next step.
17. Modify the end of
Ev_7_8_9_10.c to do the following:
enable event manager interrupt (EVAIMRC) (Hint: use the
EvaRegs structure)
enable the “CAP1” interrupt in the PIE (Hint: use the
PieCtrlRegs structure)
enable core INT3 (IER register)
18. Open and inspect the Capture Unit 1 interrupt service routine (CAPINT1_ISR) in the file
DefaultIsr_5_6_7.c
.
19. Modify the configuration file
lab.cdb to setup the PIE vector for the CAP1 interrupt.
Click on the plus sign (+) to the left of
Scheduling and again on the plus sign (+) to
the left of
HWI – Hardware Interrupt Service Routine Manager. Click
the plus sign (+) to the left of
PIE INTERRUPTS. Locate the interrupt location for the
CAP1 (use the information from step #16). Right click, select
Properties, and type
_CAPINT1_ISR
(with a leading underscore) in the function field. Click OK and save
all updates.
Build and Load
20. Save all changes to the files and click the “Build” button.
21. Reset the DSP.
Run the Code – Pulse Width Measurement
22. Open a memory window to view the address label CAP_rising. (Type &CAP_rising in
the address box).
23. Using the connector wire provided, connect the PWM1 (pin # P8-9) to CAP1 (pin # P8-6)
on the eZdsp™.
C28x - Event Manager 7 - 39