Lab 9: DSP/BIOS
Main_9.c Labcfg.cmd
Lab.cdb DSP281x_Headers_BIOS.cmd
User_8_9.cmd CodeStartBranch.asm
SysCtrl.c Gpio.c
DSP281x_GlobalVariableDefs.c PieCtrl_5_6_7_8_9.c
DefaultIsr_9_10.c Adc.c
Ev_7_8_9_10.c Filter.c
Add a SWI to main.c
2. Open Main_9.c and notice that space has been added at the end of main() for two new
functions which will be used in this module – AdcSwi() and LedBlink(). In the next few
steps, we will move part of the ADCINT_ISR() routine from DefaultIsr_9_10.c to
this space in Main_9.c.
3. Open DefaultIsr_9_10.c and locate the ADCINT_ISR() routine. Move the entire
contents of the ADCINT_ISR() routine to the AdcSwi() function in Main_9.c with the
following exceptions:
DO NOT MOVE:
• The instruction used to acknowledge the PIE group interrupt.
• The GPIO pin toggle code.
• The LED toggle code.
Be sure to move the static local variable declaration that is used to index into the ADC
buffers.
Comment: In almost all appplications, the PIE group acknowledge code is left in the HWI
(rather than move it to a SWI). This allows other interrupts to occur on that PIE group
even if the SWI has not yet executed. On the other hand, we are leaving the GPIO and
LED toggle code in the HWI just as an example. It illustrates that you can post a SWI
and also do additional operations in the HWI. DSP/BIOS is extremely flexible!
4. In the beginning of DefaultIsr_9_10.c, move the global variables, definition
statements and coefficients for the filter function to the beginning of Main_9.c.
5. Delete the interrupt key word from the ADCINT_ISR. The interrupt keyword is not
used when a HWI is under DSP/BIOS control. A HWI is under DSP/BIOS control when
it uses any DSP/BIOS functionality, such as posting a SWI, or calling any DSP/BIOS
function or macro.
6. In Main_9.c remove the in-line assembly code used to enable global interrupts.
DSP/BIOS will enable global interrupts after main().
7. In Main_9.c remove the while() loop (the endless loop). When using DSP/BIOS, you
must return from main(). DSP/BIOS will then take-over control of the software
execution.
9 - 16 C28x - Using DSP/BIOS