Reply by mahmood molaei March 16, 20082008-03-16
Dear Group

I Faced with a problem that I don't know how to deal with it
When I Read and write on codec in (dsk 5416) it does't work.
I run the default Tone program but it seems that dsp couldn't write on codec
my program is

#include "tonecfg.h"
#include "dsk5416.h"
#include "dsk5416_pcm3002.h"
#include

#define SINE_TABLE_SIZE 48
#define PI ((double)3.1415927)
#define SINE_MAX 0x7FFE

int sinetable[SINE_TABLE_SIZE];

DSK5416_PCM3002_Config setup = {

0x100, // Set-Up Reg 0 - Left channel DAC attenuation
0x1ff, // Set-Up Reg 1 - Right channel DAC attenuation
0x0, // Set-Up Reg 2 - Various ctl e.g. power-down modes
0x0 // Set-Up Reg 3 - Codec data format control
};
/*
* InitSineTable() - Initialize the sine wave table data
*/

void InitSineTable(void)
{
int i;
double increment= 0;
double radian = 0;

increment = (PI * 2) / SINE_TABLE_SIZE;
for (i = 0; i < SINE_TABLE_SIZE; i++)
{
sinetable[i] = (int)(sin(radian) * SINE_MAX);
radian += increment;
}
}

/*
* UserTask() - The main user task
*/

void UserTask()
{
DSK5416_PCM3002_CodecHandle hCodec;
int i, j;

// Initialize the sine table
InitSineTable();

// Start the codec
hCodec = DSK5416_PCM3002_openCodec(0, &setup);

// Generate a 1KHz sine wave for 30 seconds
for (i = 0; i < 30000; i++)
{
for (j = 0; j < SINE_TABLE_SIZE; j++)
{
while (!DSK5416_PCM3002_write16(hCodec, sinetable[j]));
while (!DSK5416_PCM3002_write16(hCodec, sinetable[j]));
}
}

// Close the codec
DSK5416_PCM3002_closeCodec(hCodec);
}

void main()
{
// Initialize the board support library
DSK5416_init();
}
in addition when I run 5416 DSK Diagnostics Utility,
when the program run the codec test, the result is failed
has the codec been damaged?
would you please to help me on it
best regards