Sei sulla pagina 1di 2

Sine Wave Using DSK6713

AIM

To generate a real time sine wave using TMS320C6713 DSK.


PROCEDURE
1. Connect CRO to the LINE OUT socket.
2. Now switch ON the DSK and bring up Code Composer Studio on PC
3. Create a new project with name sinewave.pjt
4. From File menu New DSP/BIOS Configuration Select dsk6713.cdb and save it as
xyz.cdb
5. Add xyz.cdb to the current project
6. Create a new source file and save it as sinewave.c
7. Add the source file sinewave.c to the project.
8. Add the library file dsk6713bsl.lib to the project
(Path: C:\CCStudio\C6000\dsk6713\lib\dsk6713bsl.lib)
9. Copy files dsk6713.h and dsk6713_aic23.h to the Project folder
10. Build (F7) and load the program to the DSP Chip (File Load Program)
11. Run the program (F5).
12. Give an output from the PC and notice the output in the CRO.
Program
#include "xyzcfg.h"
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include <stdio.h>
#include <math.h>
float a[500],b;
DSK6713_AIC23_Config config= DSK6713_AIC23_DEFAULTCONFIG;
void main()
{

int i=0;
DSK6713_AIC23_CodecHandle hCodec;
Int l_output,r_output;
DSK6713_init();
hCodec=DSK6713_AIC23_openCodec(0,&config);
DSK6713_AIC23_setFreq(hCodec, 6);
for(i=0;i<500;i++)
{
a[i]=sin(2*3.14*10000*i);
}
while(1)
{
for(i=0;i<500;i++)
{
b=400*a[i];
while(!DSK6713_AIC23_write(hCodec,b));
}
}
DSK6713_AIC23_closeCodec(hCodec);
}

Potrebbero piacerti anche