Reply by Jeff Brower February 7, 20072007-02-07
Pablo-

> DSK6713_AIC23_CodecHandle hCodec;
> Int16 msec, sample;
> Uint32 leftch, rightch;
>
> (...)
>
> /* Generate a 1KHz sine wave for 5 seconds */
> for (msec = 0; msec < 5000; msec++)
> {
> for (sample = 0; sample < SINE_TABLE_SIZE; sample++)
> { leftch=(sinetable[sample]<<16);
> /* Send a sample to the left channel */
> while (!DSK6713_AIC23_write(hCodec, leftch));
>
> rightch=(sinetable[sample]>>16);
> /* Send a sample to the right channel */
> while (!DSK6713_AIC23_write(hCodec, rightch));
> }
> }
>
> I take the 16 bit sample and turn into a 32bit variable. As you
> said, lefch has the first 16 bits with the value of the sample. On the other hand,
> rightch has the last 16 bits with the value of the sample. Is this correct?? I
> don't think so, because I have loaded it on the board and it doesn't sound. What is
> the mistake??

I had written another post to Joshy indicating that I was incorrect and 2x 16-bit
reads/writes are needed. Suggest to try this:

short int i;
int lch, rch;

while (1) {

for (i=0; i
lch = sinetable[i];
rch = -lch;

while (!DSK6713_AIC23_write(hCodec, lch)); /* write left ch */
while (!DSK6713_AIC23_write(hCodec, rch)); /* write right ch */
}
}

You should hear continuous tone on both channels, with no static or pops. Each
channel should sound the same, but if you look with dig scope, they should be 180 out
of phase. Frequency of the tone should be sampling rate / length of sine table. For
example if sampling rate is 16 kHz, then you should hear 62.5 Hz tone (assuming sine
table length is 256 -- I don't know that offhand). Note that if you set the sampling
rate too low, then you won't hear the tone (but you can still see it on the scope).

-Jeff

> -----------
>
> From: Jeff Brower
> To: Joshy Jose
> CC: c...
> Subject: Re: [c6x] reading values from aic23d codec in c6713 dsk
> Date: Fri, 02 Feb 2007 14:08:12 -0600
>
> Joshy-
>
> > i need to take values from audio codec in c6713 dsk?
> > as there are two lines (left , right) microphone input , i need to
> > take values from each line seperately, and process it
> > i have tried with the function
> > DSK6713_AIC23_read() available in the dsk but i could not successfuly do it
> > i used
> > while (!DSK6713_AIC23_read(hCodec, data ));
> > while (!DSK6713_AIC23_read(hCodec, data ));
> >
> > to get two line values,
> >
> > what is the correct way to do this?
>
> Each call to DSK6713_AIC23_read() should return a 32-bit value, with high and low
> words being the 2 channel (line) samples. Check this post for some example C code:
>
> http://www.dsprelated.com/groups/c6x/show/6704.php
>
> In your code above, you are actually waiting for four (4) values, discarding the
> first 2, and therefore cutting the sampling rate in half.
>
> -Jeff
Reply by February 6, 20072007-02-06


         Hi Jeff, I have tried this to make the codec work:


    DSK6713_AIC23_CodecHandle hCodec;
    Int16 msec, sample;

    Uint32 leftch, rightch;

     (...)



    /* Generate a 1KHz sine wave for 5 seconds */
    for (msec = 0; msec < 5000; msec++)
    {
        for (sample = 0; sample < SINE_TABLE_SIZE; sample++)
        {   leftch=(sinetable[sample]<<16);
            /* Send a sample to the left channel */
   while (!DSK6713_AIC23_write(hCodec, leftch));


            rightch=(sinetable[sample]>>16);
            /* Send a sample to the right channel */
   while (!DSK6713_AIC23_write(hCodec, rightch));
        }
    }


                  I take the 16 bit sample and turn into a 32bit variable. As you said, lefch has the first 16 bits with the value of the sample. On the other hand, rightch has the last 16 bits with the value of the sample. Is this correct?? I don't think so, because I have loaded it on the board and it doesn't sound. What is the mistake??


               Thanks for all,


        Pablo L.


 






From: Jeff Brower <j...@signalogic.com>
To: Joshy Jose <j...@gmail.com>
CC: c...
Subject: Re: [c6x] reading values from aic23d codec in c6713 dsk
Date: Fri, 02 Feb 2007 14:08:12 -0600







Joshy-

> i need to take values from audio codec in c6713 dsk?
> as there are two lines (left , right) microphone input , i need to
> take values from each line seperately, and process it
> i have tried with the function
> DSK6713_AIC23_read() available in the dsk but i could not successfuly do it
> i used
> while (!DSK6713_AIC23_read(hCodec, data ));
> while (!DSK6713_AIC23_read(hCodec, data ));
>
> to get two line values,
>
> what is the correct way to do this?

Each call to DSK6713_AIC23_read() should return a 32-bit value, with high and low
words being the 2 channel (line) samples. Check this post for some example C code:

http://www.dsprelated.com/groups/c6x/show/6704.php

In your code
above, you are actually waiting for four (4) values, discarding the
first 2, and therefore cutting the sampling rate in half.

-Jeff






__._,_.___







">http://www.dsprelated.com/groups/c6x/1.php



_____________________________________

Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer.  You need to do a "reply all" if you want your answer to be distributed to the entire group.



_____________________________________

About this discussion group:



Archives:  http://www.dsprelated.com/groups/c6x/1.php



To Post:  Send an email to c...



Other DSP Related Groups: http://www.dsprelated.com/groups.php









stime70777233













__,_._,___
Reply by Jeff Brower February 5, 20072007-02-05
Joshy-

> then how to write the values to codec?
> in sample programs , i seec two writes
> for sending data to codec
>
> while (!DSK6713_AIC23_write(hCodec, data ));
> while (!DSK6713_AIC23_write(hCodec, data ));
> where data variable is declared to be int16,
> and it is working properly, is that correct?
> i mean writing 16 bit for first line and and another 16 bit for another line?
>
> this is from the example programs in dsk67x
> " C:\CCStudio_v3.1\examples\dsk6713\bsl\tone"

In that case you may be right, it may take two consecutive 16-bit writes. If that's the case, then Spectrum Digital
should not have written the function that way, or should have labeled the function DSK6713_AIC23_write16().

-Jeff

> On 03/02/07, Jeff Brower wrote:
>> Joshy-
>>
>> > i need to take values from audio codec in c6713 dsk?
>> > as there are two lines (left , right) microphone input , i need to
>> > take values from each line seperately, and process it
>> > i have tried with the function
>> > DSK6713_AIC23_read() available in the dsk but i could not successfuly do it
>> > i used
>> > while (!DSK6713_AIC23_read(hCodec, data ));
>> > while (!DSK6713_AIC23_read(hCodec, data ));
>> >
>> > to get two line values,
>> >
>> > what is the correct way to do this?
>>
>> Each call to DSK6713_AIC23_read() should return a 32-bit value, with high and low
>> words being the 2 channel (line) samples. Check this post for some example C code:
>>
>> http://www.dsprelated.com/groups/c6x/show/6704.php
>>
>> In your code above, you are actually waiting for four (4) values, discarding the
>> first 2, and therefore cutting the sampling rate in half.
>>
>> -Jeff
>>
> --
> regards,
> Joshy m. Jose
> kerala , India
> 91-9447976001
>
Reply by Jeff Brower February 5, 20072007-02-05
Joshy-

> i need to take values from audio codec in c6713 dsk?
> as there are two lines (left , right) microphone input , i need to
> take values from each line seperately, and process it
> i have tried with the function
> DSK6713_AIC23_read() available in the dsk but i could not successfuly do it
> i used
> while (!DSK6713_AIC23_read(hCodec, data ));
> while (!DSK6713_AIC23_read(hCodec, data ));
>
> to get two line values,
>
> what is the correct way to do this?

Each call to DSK6713_AIC23_read() should return a 32-bit value, with high and low
words being the 2 channel (line) samples. Check this post for some example C code:

http://www.dsprelated.com/groups/c6x/show/6704.php

In your code above, you are actually waiting for four (4) values, discarding the
first 2, and therefore cutting the sampling rate in half.

-Jeff
Reply by joshy jose February 2, 20072007-02-02
hai friends,
i need to take values from audio codec in c6713 dsk?
as there are two lines (left , right) microphone input , i need to
take values from each line seperately, and process it
i have tried with the function
DSK6713_AIC23_read() available in the dsk but i could not successfuly do it
i used
while (!DSK6713_AIC23_read(hCodec, data ));
while (!DSK6713_AIC23_read(hCodec, data ));

to get two line values,
what is the correct way to do this?

--
regards,
Joshy m. Jose
kerala , India
91-9447976001