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.

C5505 eZdsp - ISSUES EMITTING 1 Khz Tone

Hi,

I'm working on Soc C5505 eZdsp.

I have configured AIC3204 codec to be mono (left channel only) at 192Khz sample/playback rate.

I'm trying to emit to the line-out of the board a single tone (1 Khz) tone.

Here are the significant pieces of my code:

#define XmitL 0x10
#define I2S0_SRGR          *(volatile ioport Uint16*)(0x2804)
#define I2S0_CR            *(volatile ioport Uint16*)(0x2800)
#define I2S0_ICMR          *(volatile ioport Uint16*)(0x2814)
#define I2S0_IR            *(volatile ioport Uint16*)(0x2810)
#define I2S0_W0_LSW_W      *(volatile ioport Uint16*)(0x2808)
#define I2S0_W0_MSW_W      *(volatile ioport Uint16*)(0x2809)

Int16 sine_1K[192] = {
        0x0430,0x085F,0x0C8C,0x10B5,0x14DA,0x18F9,0x1D11,0x2121,0x2528,0x2925,0x2D17,0x30FC,0x34D4,0x389D,0x3C57,0x4000,
        0x4398,0x471D,0x4A8F,0x4DEC,0x5134,0x5465,0x5780,0x5A82,0x5D6C,0x603C,0x62F2,0x658D,0x680B,0x6A6E,0x6CB3,0x6EDA,
        0x70E3,0x72CD,0x7497,0x7642,0x77CC,0x7935,0x7A7D,0x7BA3,0x7CA8,0x7D8A,0x7E4A,0x7EE8,0x7F62,0x7FBA,0x7FEE,0x7FFF,
        0x7FEE,0x7FBA,0x7F62,0x7EE8,0x7E4A,0x7D8A,0x7CA8,0x7BA3,0x7A7D,0x7935,0x77CC,0x7642,0x7497,0x72CD,0x70E3,0x6EDA,
        0x6CB3,0x6A6E,0x680B,0x658D,0x62F2,0x603C,0x5D6C,0x5A82,0x5780,0x5465,0x5134,0x4DEC,0x4A8F,0x471D,0x4398,0x4000,
        0x3C57,0x389D,0x34D4,0x30FC,0x2D17,0x2925,0x2528,0x2121,0x1D11,0x18F9,0x14DA,0x10B5,0x0C8C,0x085F,0x0430,0x0000,
        0xFBD0,0xF7A1,0xF374,0xEF4B,0xEB26,0xE707,0xE2EF,0xDEDF,0xDAD8,0xD6DB,0xD2E9,0xCF04,0xCB2C,0xC763,0xC3A9,0xC000,
        0xBC68,0xB8E3,0xB571,0xB214,0xAECC,0xAB9B,0xA880,0xA57E,0xA294,0x9FC4,0x9D0E,0x9A73,0x97F5,0x9592,0x934D,0x9126,
        0x8F1D,0x8D33,0x8B69,0x89BE,0x8834,0x86CB,0x8583,0x845D,0x8358,0x8276,0x81B6,0x8118,0x809E,0x8046,0x8012,0x8000,
        0x8012,0x8046,0x809E,0x8118,0x81B6,0x8276,0x8358,0x845D,0x8583,0x86CB,0x8834,0x89BE,0x8B69,0x8D33,0x8F1D,0x9126,
        0x934D,0x9592,0x97F5,0x9A73,0x9D0E,0x9FC4,0xA294,0xA57E,0xA880,0xAB9B,0xAECC,0xB214,0xB571,0xB8E3,0xBC68,0xC000,
        0xC3A9,0xC763,0xCB2C,0xCF04,0xD2E9,0xD6DB,0xDAD8,0xDEDF,0xE2EF,0xE707,0xEB26,0xEF4B,0xF374,0xF7A1,0xFBD0,0x0000
};

void emit_sine_1K(void){
    Uint16 i;
    Uint16 j;
    I2S0_SRGR = 0x0;
    I2S0_CR = 0x9011;
    I2S0_ICMR = 0x3f;    

    for(j = 0; j < 5000; j++){ // five seconds duration
        for(i = 0; i < 192; i++){
            while((XmitL & I2S0_IR) == 0);     
            I2S0_W0_LSW_W = (sine_1K[i]) ; // tramsmitting signal to left channel
        }
    }
    I2S0_CR = 0x00;
}

By debugging i see always the program stops in the while loop, like the transmit never occur.

Any idea?

Thanks in advance.

Paolo