AnsweredAssumed Answered

Packed Multichannel 24-bit

Question asked by dmann on Apr 5, 2011
Latest reply on Apr 5, 2011 by dmann

Hello,

 

I am trying to configure the ADSP-21375 to RX and TX data from a 6 in/6 out multichannel codec used in a custom board.

 

The codec is driven by a dedicated external clock. During the frame sync period, the left ADC/DAC channels are RX/TX'd on the positive half of the frame sync and the right ADC/DAC channels are RX/TX'd on the negative half. The timing diagram is below. I am unsure how to handle the delay between the third word and the LRCK frame sync as far as SPORT Configuration. Would I want to use Multichannel or Packed Mode? What configuration would work?

 

codec_timing.bmp

 

I am desiring to TX on SPORT0 and RX on SPORT1, due to the assignment of the Multichannel RX/TX Channel Select Registers (MT1CS0/MR0CS0) respectively.

 

From the timing diagram, can you please double check my configuration settings? In addition, I am using rotating DMA to handle input/process/output blocks.

 

//MULTICHANNEL CONFIG SETTINGS

 

*pSPCTL0 = (BHD | SLEN24 | SCHEN_A | SDEN_A  | SPTRAN ); //CKRE and OPMODE Didn't seem to make a difference

*pSPCTL1 = (BHD | SLEN24 | SCHEN_A | SDEN_A  );

 

*pSPMCTL0 = (NCH5 | MCEA);
*pSPMCTL1 = (NCH5 | MCEA);

 

*pMR1CS0 = 0x3F; // 6 channels RX
*pMT0CS0 = 0x3F; //6 channels TX

 

 

#define NUM_SAMPLES 6

unsigned int PCI = 0x00080000 ;
unsigned int OFFSET = 0x00080000 ;

unsigned int *src_pointer[3] = {Block_A,Block_C,Block_B};

 

//AUDIO SAMPLE BLOCKS
unsigned int Block_A[NUM_SAMPLES] ;
unsigned int Block_B[NUM_SAMPLES] ;
unsigned int Block_C[NUM_SAMPLES] ;

 

//TRANSFER CONTROL BLOCKS
//Init TCBs to Point w/ no Internal Index[3] and null Chain Pointer[0]
int TCB_Block_A[4] = { 0, sizeof(Block_A), 1, 0};
int TCB_Block_B[4] = { 0, sizeof(Block_B), 1, 0};
int TCB_Block_C[4] = { 0, sizeof(Block_C), 1, 0};

 

void InitSPORT()
{
    //SETUP CIRCULAR BLOCK STRUCTURE
    //CONFIG BLOCK_A TCB
    TCB_Block_A[0] = (int) TCB_Block_C + 3 - OFFSET + PCI ; //SET CHAIN POINTER TO BLOCK C
    TCB_Block_A[3] = (unsigned int) Block_A - OFFSET ;        //SET INTERNAL ADDRESS TO BLOCK A

 

    //CONFIG BLOCK_B TCB
    TCB_Block_B[0] = (int) TCB_Block_A + 3 - OFFSET + PCI ;    //SET CHAIN POINTER TO BLOCK A
    TCB_Block_B[3] = (unsigned int) Block_B - OFFSET ;        //SET INTERNAL ADDRESS TO BLOCK B   

 

    //CONFIG BLOCK_C TCB
    TCB_Block_C[0] = (int) TCB_Block_B + 3 - OFFSET + PCI ; //SET CHAIN POINTER TO BLOCK B
    TCB_Block_C[3] = (unsigned int) Block_C - OFFSET ;        //SET INTERNAL ADDRESS TO BLOCK C

 

    //Clear the Mutlichannel control registers
    *pSPMCTL0 = 0;
    *pSPMCTL1 = 0;
    *pSPMCTL2 = 0;
    *pSPCTL0 = 0 ;
    *pSPCTL1 = 0 ;
    *pSPCTL2 = 0 ;

 

}

 

void TalkThroughISR(int sig_int)
{
    if(isProcessing)
        ProcessingTooLong();

 

    //Increment the block pointer
    int_cntr++;
    int_cntr %= 3;

 

    blockReady = 1;

 

}

Outcomes