View Single Post
  #3 (permalink)  
Old 02-25-2005, 08:34 PM
CyRex
Guest
 
Posts: n/a
Default Re: The changing of sampling rate of AD1819A


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