View Single Post
  #4 (permalink)  
Old 02-25-2005, 09:41 PM
Jaime Andrés Aranguren Cardona
Guest
 
Posts: n/a
Default Re: The changing of sampling rate of AD1819A

Hi Guys,

Beware that it is not simply changing the register what works for this
particular CODEC.

There was an extremely interesting document in ADI website title
"Interfacing the ADSP21065L SHARC DSP to the AD1819A AC-97 Soundport
Codec", which you can get from here:

http://www.analog.com/UploadedFiles/...19A_21065L.pdf

It very thoroughly explains how to do it.

I have a C version of this. If you want it, I'd be glad to share it.

Please write to me at [email protected], and I will send it in a few
hours (I don't have it right here).

Regards,

JaaC


CyRex wrote:
> Marek...
>
> This the register addresses for the audio codec are defined in the
> section "CONSTANT & MACRO DEFINITIONS". You will want to add the
> following values to that section:
>
> **********************
> #define SAMPLE_RATE_8KHZ 0x401F
>
> #define SAMPLE_RATE0_ADDR 0x7800
> #define SAMPLE_RATE1_ADDR 0x7A00
> **********************
>
> 78h and 7Ah are the addresses for the registers that control the

sample
> rates. The setting for 8kHz is 8000 in hex, or 1F40 (swapped in the
> SHARC so its 401F). This will define your contants.
>
> Next, in the procedure init_codec(), you need to send the correct
> commands to initialize the codec:
>
> ***********************
> /* Set Sample Rate 0 to 8kHz */
> user_tx_buf[TAG] = REGOUT_TAG;
> user_tx_buf[ADDR] = SAMPLE_RATE0_ADDR;
> user_tx_buf[DATA] = SAMPLE_RATE_8KHZ;
> user_tx_ready = 1; /* Tell the isr that txbuf is

ready
> */
> idle();
> idle();
>
> /* Set Sample Rate 1 to 8kHz */
> user_tx_buf[TAG] = REGOUT_TAG;
> user_tx_buf[ADDR] = SAMPLE_RATE1_ADDR;
> user_tx_buf[DATA] = SAMPLE_RATE_8KHZ;
> user_tx_ready = 1; /* Tell the isr that txbuf is

ready
> */
> idle();
> idle();
> ***********************
>
> I haven't worked with the SHARC in 3 years or so, and this is mostly
> from memory, so it may not be exactly right. If you need any more
> reference, check out this link:
>
>

http://www.analog.com/UploadedFiles/...887AD1819A.pdf
>
> Good Luck!
> - CyRex


Reply With Quote