Lab 9: DSP/BIOS
Post a SWI
8. In
DefaultIsr_9_10.c
add the following SWI_post to the ADCINT_ISR(), just
after the structure used to acknowledge the PIE group:
SWI_post(&ADC_swi);
// post a SWI
This post a SWI that will execute the ADC_swi() code you populated a few steps back in
the lab. In other words, the ADC interrupt still executes the same code as before.
However, some of that code is now in a posted SWI that DSP/BIOS will execute
according to the specified scheduling priorities.
Add the SWI to the CDB File
9. In the configuration file
Lab.cdb
we need to add and setup the AdcSwi() SWI. Open
Lab.cdb
and click on the plus sign (+) to the left of
Scheduling
and again on the
plus sign (+) to the left of
SWI – Software Interrupt Manager
.
10. Right click on
SWI – Software Interrupt Manager
and select
Insert SWI
.
SWI0
will be added. Right-click on it, and rename it to
ADC_swi
. This is just an
arbitrary name. We want to differentiate the AdcSwi() function itself (which is nothing
but an ordinary C function) from the DSP/BIOS SWI object which we are calling
ADC_swi.
11. Select the
Properties
for
ADC_swi
and type
_AdcSwi
(with a leading underscore)
in the function field. Click
OK
. This tells DSP/BIOS that it should run the function
AdcSwi() when it executes the ADC_swi SWI.
12. We need to have the PIE for the ADC interrupt use the dispatcher. The dispatcher will
automatically perform the context save and restore, and allow the DSP/BIOS scheduler to
have insight into the ISR. You may recall from an earlier lab that the ADC interrupt is
located at PIE_INT1_6.
Click 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 ADC: PIE_INT1_6. Right click, select
Properties
, and
select the
Dispatcher
tab.
Now check the
“Use Dispatcher”
box and select
OK
. Close the configuration file
and click
YES
to save changes.
Build, Load, and Reset
13. Click the
“Build”
button to rebuild and load the project.
14. Reset the DSP.
C28x - Using DSP/BIOS
9 - 17
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 ...