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
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...