Digital Signal Processing Reference
In-Depth Information
verify that the 1-kHz tone is now generated continuously (a much faster and con-
tinuous, unnoticeable burst).
Example 9.2: Blinking of LEDs at Different Rates Using
DSP/BIOS ( bios_4LED )
This example illustrates the use of the periodic function manager within the con-
figuration file to control the blinking rates of the four onboard LEDs. The C source
program bios _ 4led.c is shown in Figure 9.4. Create the .cdb configuration file using
four functions from the PRD-Periodic Function Manager: PRD _ blinkLED0 ,...,
PRD _ blinkLED3 with the following periods: 50, 100, 200, and 400 ms and associ-
ated functions _blinkLED0,..., blinkLED3 , respectively. Save and add this con-
figuration file to the project along with the BSL support library file. The linker
command file, autogenerated by the configuration file, needs to be added to the
project (the other autogenerated support files will be added). See Example 9.1. The
necessary files for this project are in the folder bios4LED .
Build this project as bios_4led . Verify the different blinking rates of each
of the LEDs, ranging from approximately 50 ms (LED0) to 400 ms (LED3). Change
the blinking rates by changing the values of the periods set in the configuration
file.
// Bios_4LED.c Blinking of LEDs at different rates using DSP/BIOS
#include "bios_4ledcfg.h"
//generated by .cdb file
#include "dsk6713.h"
//BSL support file
void blinkLED0()
{
DSK6713_LED_toggle(0);
//toggle LED0(50ms)
}
void blinkLED1()
{
DSK6713_LED_toggle(1);
//toggle LED1(100ms)
}
void blinkLED2()
{
DSK6713_LED_toggle(2); //toggle LED2(200ms)
}
void blinkLED3()
{
DSK6713_LED_toggle(3);
//toggle LED3(400ms)
}
void main()
{
DSK6713_init();
//init BSL
}
FIGURE 9.4. C program for controlling the blinking rates of the onboard LEDs using
DSP/BIOS ( bios_4LED.c ).
Search WWH ::




Custom Search