DSPRelated.com
Forums

About the transmission between DAI and AD1835

Started by sang...@gmail.com March 13, 2008
Hi,
Thank you for your help.
The AD1835's data is in 24-bit format. In "Sample Playbcak" example for ADSP21364 "(*pTXSP1A) (int)temp<<16;", we send 32-bit word to the SPORT while only the most
significant 16 bits are useful. So, what does the AD1835 receive? Only
the most significant 16 bits? or 24 bits in which the 8 LSBs are zero?
or 24 bits in which the MSBsare zero?
My question occurs in AD conversion, too. Actually, in the
initialization of the SPORT in the "Sample Playback", it writes
"
*pSPCTL0 = (BHD | OPMODE | SLEN24 | SPEN_A | SCHEN_A | SDEN_A);
// Enabling Chaining
// Block A will be filled first
*pCPSP0A = (unsigned int) TCB_Block_A - OFFSET + 3 ;
".
In terms of my understanding, all the data from SPORT0 will
automatically fill in the Block_A. I've used debug mode to check the
data format. The 24 bits from ADC occupy the LSBs. But the value from
ADC is something different from expected. The formula of AD conversion
is:
Vin*(2^23)/Vref=N.
Vref=2.25.
Is that right?
Actually, I try to play a 1kHz audio signal through DAC1. The data of
the 1kHz signal are stored in flash previously. With 48kHz sample
rate, each period of the 1kHz signal has 48 points. Obviously, almost
half of the 48 points are negative. But in the Block_A which directly
receives data from ADC, 1024 consecutive points are positive according
to the two-complement coding scheme. Below is my example, which does a
little change to the original file.
int processBlock(unsigned int *block_ptr)
{
int i;
float temp_out;
unsigned int temp_array[NUM_SAMPLES]={0};
int average;
unsigned int peakl;
//Clear the Block Ready Semaphore
blockReady = 0;

//Set the Processing Active Semaphore before starting processing
isProcessing = 1;
average=0;

for(i=0;i {
//*(block_ptr+i) = *(block_ptr+i);
//*************************************************************
// to check the value from ADC
temp_array[i]=(*(block_ptr+i));
//************************************************************
average+=(*(block_ptr+i));
}

//Clear the Processing Active Semaphore after processing is complete
isProcessing = 0;
return average;
}
Could you help me with this problem?
Thank you for your great help.