Digital Signal Processing Reference
In-Depth Information
// bios_sine_ctrl.c Sine generation with DIP Switch control
#include "bios_sine_ctrlcfg.h" //generated support file
#include "dsk6713_led.h"
#include "dsk6713_dip.h"
#include "dsk6713_aic23.h" //codec-DSK support file
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ;
//set sampling rate
short sine_on = 0, loop = 0, gain = 10;
short sine_table[8] = {0,707,1000,707,0,-707,-1000,-707};
void sinegen()
{
if (DSK6713_DIP_get(2) == 0)
//if sw#2 pressed
{
DSK6713_LED_on(2); //turn on led#2
while(++sine_on < 5000) //generate sine wave
{ //for 5 sec
output_sample(sine_table[loop]*gain);//output
if (++loop > 7) loop = 0;
}
sine_on = 0;
}
DSK6713_LED_off(2);
}
void blinkLED0()
{
DSK6713_LED_toggle(0);
if (DSK6713_DIP_get(3) == 0) DSK6713_LED_on(3);
else DSK6713_LED_off(3);
}
void main()
{
comm_poll();
DSK6713_LED_init();
DSK6713_DIP_init();
}
FIGURE 9.2. C source program for sine generation with DIP switch control through
DSP/BIOS ( bios_sine_ctrl.c ).
7. Two support files, bios _ sine _ ctrlcfg.s62 and bios _ sine _ ctrlcfg _ c.c , have been
autogenerated by the configuration file and added to the project. Verify
that by expanding on Generated Files. A linker command file,
bios _ sine _ ctrlcfg.cmd , was also generated and must be added to the project by
the user.
8. A header file, bios _ sine _ ctrlcfg.h , was also autogenerated and must be included
in the main C source file. Scan all files dependencies and verify that a number
of chip support files have been included in the project.
Preprocessor. Set Define Symbols (d) to
CHIP_6713 and target version to C671x. From the Linker Tab
Select Project
Æ
Build Options
Æ
Æ
Include Libraries
Search WWH ::




Custom Search