AN1836-AN21161 Analog Devices, AN1836-AN21161 Datasheet - Page 60

no-image

AN1836-AN21161

Manufacturer Part Number
AN1836-AN21161
Description
Interfacing the ADSP-21161 SIMD SHARC DSP to the AD1836 (24-bit/96 kHz) Multichannel Codec
Manufacturer
Analog Devices
Datasheet
#define RX_BUF1A_LEN
int rx_buf1a[RX_BUF1A_LEN];
void
{}
int
{
ADC_CONTROL2 | WRITE_REG | 0x380,
// read register commands
ADC0_PEAK_LEVEL | READ_REG | 0x000, // status will be in rx_buf1a[13-19] memory locations
ADC1_PEAK_LEVEL | READ_REG | 0x000,
ADC2_PEAK_LEVEL | READ_REG | 0x000,
ADC3_PEAK_LEVEL | READ_REG | 0x000,
ADC_CONTROL1
ADC_CONTROL2
ADC_CONTROL3
SPORT_RX_IRQ( int sig_int)
Setup_AD1836()
int i;
/* Powerdown reset of AD1836 */
*(int *) II3A = (int) powerdown_AD1836;
*(int *) IM3A = 1;
*(int *) C3A
*(int *) II1A = (int) powerdown_rx_buf0a;
*(int *) IM1A = 1;
*(int *) C1A
*(int *) SP13MCTL = 0;
*(int *) DIV3 = 0x0011002B;
*(int *) DIV1 = 0;
*(int *) SPCTL3 |= DDIR | SDEN_A | LAFS | LFS |
*(int *) SPCTL1 |= SDEN_A | LAFS | LFS | FSR | CKRE | SLEN16 | SPEN_A;
*(int *) SPCTL1 &= (~DDIR & ~IFS & ~ICLK);
interruptf(
interruptf( SIG_SP3I, SPORT_RX_IRQ);
while ( (*(int*) DMASTAT) & 0x8 )
interruptf(
interruptf( SIG_SP3I, SIG_IGN);
/* Now, stall for about 1 second */
for (i=0;i<3000;i++)
*(int *) SPCTL1 = 0;
*(int *) SPCTL3 = 0;
/* SPORT DMA Setup */
*(int *) II3A = (int) tx_buf3a;
*(int *) IM3A = 1;
*(int *) C3A
*(int *) II1A = (int) rx_buf1a;
*(int *) IM1A = 1;
*(int *) C1A = RX_BUF1A_LEN;
*(int *) SP13MCTL = 0;
*(int *) DIV3 = 0x0011002B;
*(int *) DIV1 = 0;
*(int *) SPCTL3 |= DDIR | SDEN_A | LAFS | LFS |
*(int *) SPCTL1 |= SDEN_A | LAFS | LFS | FSR | CKRE | SLEN16 | SPEN_A;
*(int *) SPCTL1 &= (~DDIR & ~IFS & ~ICLK);
interruptf( SIG_SP1I, SPORT_RX_IRQ);
interruptf( SIG_SP3I, SPORT_RX_IRQ);
asm("idle;");
asm("nop; nop; nop; nop; nop;");
= 4;
= 4;
= TX_BUF3A_LEN;
| READ_REG | 0x000,
| READ_REG | 0x000,
| READ_REG | 0x000 };
21
SIG_SP1I,
SIG_SP1I,
SPORT_RX_IRQ);
SIG_IGN);
IFS | FSR | CKRE | ICLK | SLEN16 | SPEN_A;
IFS | FSR | CKRE | ICLK | SLEN16 | SPEN_A;

Related parts for AN1836-AN21161