This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

graph

Hi Jyothi,

I have attached an old lab material to create and run a sinewave generation project. Please do check whether it works out for you.

8611.Lab.pdf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include "dsk6713_led.h"
#include "dsk6713_dip.h"
// t a b l e inde x
short loop = 0 ;
// gain f a c t o r
short gain = 10 ;
// output b u f f e r
Int16 out_buffer[256];
// s i z e o f b u f f e r
const short BUFFERLENGTH = 256;
// counter f o r b u f f e r
int i = 0 ;
DSK6713_AIC23_Config config = { \
0x0017 , /* 0 DSK6713 AIC23 LEFTINVOL*/\
0x0017 , /* 1 DSK6713 AIC23 RIGHTINVOL*/\
0x00d8 , /* 2 DSK6713 AIC23 LEFTHPVOL*/\
0x00d8 , /* 3 DSK6713 AIC23 RIGHTHPVOL*/\
0x0011 , /* 4 DSK6713 AIC23 ANAPATH*/\
0x0000 , /* 5 DSK6713 AIC23 DIGPATH*/\
0x0000 , /* 6 DSK6713 AIC23 POWERDOWN*/\
0x0043 , /* 7 DSK6713 AIC23 DIGIF*/\
0x0081 , /* 8 DSK6713 AIC23 SAMPLERATE*/\
0x0001 /* 9 DSK6713 AIC23 DIGACT*/\
} ;
// Lookup t a b l e
//Int16 sinetable[8]={0,707,1000,707,0,-707,-1000,-707};
Int16 sine_table[48] = {
0x0000 , 0x10b4 , 0x2120 , 0x30fb , 0x3fff, 0x4dea ,
0x5a81 , 0x658b , 0x6ed8 , 0x763f , 0x7ba1 , 0x7ee5 ,
0x7ffd , 0x7ee5 , 0x7ba1 , 0x76ef , 0x6ed8 , 0x658b ,
0x5a81 , 0x4dea , 0x3fff , 0x30fb , 0x2120 , 0x10b4 ,
0x0000 , 0xef4c , 0xdee0 , 0xcf06 , 0xc002 , 0xb216 ,
0xa57f , 0x9a75 , 0x9128 , 0x89c1 , 0x845f , 0x811b ,
0x8002 , 0x811b , 0x845f , 0x89c1 , 0x9128 , 0x9a76 ,
0xa57f , 0xb216 , 0xc002 , 0xcf06 , 0xdee0 , 0xef4c
} ;
Uint32 fs = DSK6713_AIC23_FREQ_48KHZ ;
// main ( ) − Main code rout ine , i n i t i a l i z e s BSL and
// runs LED a p p l i c a t i o n
void main ()
{
DSK6713_AIC23_CodecHandle hCodec ;
// I n i t i a l i z e the board suppor t l i b r a r y , must be f i r s t
// BSL c a l l
DSK6713_init () ;
// I n i t i a l i z e the LED and DIP swi t c h modules o f the BSL
DSK6713_LED_init () ;
DSK6713_DIP_init () ;
// St a r t the codec
hCodec = DSK6713_AIC23_openCodec (0, &config ) ;
// DIP Swi tch API
// DSK6713 DIP get ( Uint32 dipNum)
// Return v a lue 0 S p e c i f i e d swi t c h i s o f f
// Return v a lue 1 S p e c i f i e d swi t c h i s on
// i n f i n i t e loop
while ( 1 )
{
if (DSK6713_DIP_get(0) == 0)
{
// turn LED#0 on
DSK6713_LED_on( 0 ) ;
outbuffer[i] = sinetable[loop] ;
// wh i l e ( r e t u r n v a l u e i s not z e ro )
// s e e DSK6713 AIC23 write ( . . . )
// send data to l e f t channel
// output e v e ry Ts SW0
while ( !DSK6713_AIC23_write (hCodec , sinetable [loop] * gain ) ) ;
// send data to r i g h t channel
while ( !DSK6713_AIC23_write (hCodec , sinetable[loop ] * gain ) ) ;
i++;
if ( i==BUFFERLENGTH) i =0;
// check f o r end of t a b l e
if ( ++loop > 47) loop = 0 ;
}
//LED#0 o f f
else DSK6713_LED_off(0) ;
} //end o f wh i l e (1)
}

 

Hi, Shankari

i used the avobe program i got errors and warnings for it. But i dint get the required graph for it/