Sign in

username:

password:



Not a member?

Search c54x



Search tips

Subscribe to c54x



c54x by Keywords

5409 | 5416 | AD5 | ADC | BIOS | Boot | Booting | Bootloader | C540 | C5402 | C5409 | C5416 | CCS | Codec | DMA | Dmad | DSK | DSKPlus | Dsplib | EVM | FFT | FIR | Flash | GPIO | HPI | Initialization | Interrupt | JTAG | LOG_printf | MCBSP | RFFT | RTDX | Sampling | STLM | UART | VC540

Ads

Discussion Groups

Discussion Groups | TMS320C54x | codec Problem

Technical discussions about the TI C54x DSPs (including the c5401, c5402, c5402a, c5404, c5407, c5409, c5409a, c5410, c5410a, c5416, c5420, c5421, c5441, c549, c5470 and c5471).

  

Post a new Thread

codec Problem - mahmood molaei - Mar 16 20:26:46 2008



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 <math.h>

#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

------------------------------------

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467



(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )