AnsweredAssumed Answered

DAI Configuration, SHARC 21469

Question asked by mjames2393 on Aug 29, 2012
Latest reply on Aug 31, 2012 by jeyanthi.jegadeesan

I am trying to set up a TalkThru project where audio from the ADC is resampled down to 16kHz before it's being processed by my algorithm. The output of the algorithm is then resampled back up to 48kHz before it is sent to the DAC.



Data from the ADC is sent to SRC0. SRC0 resamples the data and sends it to SPORT0. Data from SPORT0 is placed in a buffer for processing. The data in the buffer is processed by my algorithm. The processed data is then sent to SPORT1 which sends it off to SRC1. SRC1 resamples the data and sends it to the DAC. SRC0 should resample from 48kHz to 16kHz and SRC1 should resample from 16kHz to 48kHz .


I think the DAI config should look something like what you see below, but I think the CODEC needs an MCLK signal as well. I know for a fact that on ADSP21364 you would do this by routing DAI17 to DAI06 (as far as I remember), but those pins are hardwired to something else on ADSP21469. So what am I missing here??


I'm also missing information as to which registers should be set to configure the SRCs for the right resampling ratio. I believe pDIV is one of the registers which have to be set, but I don't know which value I should write to that register. There must be some kind of "formula" I can use to calculate the values and to set it up correctly.




#include <sru.h>

#include <def21469.h>


// This function will setup the SRU Registers

void InitSRU(void)


    //Generating Code for connecting : SPORT0_CLK to SRC0_CLK_OP



    //Generating Code for connecting : SPORT0_FS to SRC0_FS_OP



    //Generating Code for connecting : SPORT1_CLK to SRC1_CLK_IP



    //Generating Code for connecting : SPORT1_FS to SRC1_FS_IP



    //Generating Code for connecting : SPORT1_DA to SRC1_DAT_IP



    //Generating Code for connecting : DAI_PIN5 to SRC0_DAT_IP

    SRU (LOW, PBEN05_I);

    SRU (DAI_PB05_O, SRC0_DAT_IP_I);


    //Generating Code for connecting : DAI_PIN7 to SRC1_CLK_OP

    SRU (LOW, PBEN07_I);

    SRU (DAI_PB07_O, SRC1_CLK_OP_I);


    //Generating Code for connecting : DAI_PIN7 to SRC0_CLK_IP

    SRU (LOW, PBEN07_I);

    SRU (DAI_PB07_O, SRC0_CLK_IP_I);


    //Generating Code for connecting : DAI_PIN7 to DAI_PIN13

    SRU (LOW, PBEN07_I);

    SRU (HIGH, PBEN13_I);

    SRU (DAI_PB07_O, DAI_PB13_I);


    //Generating Code for connecting : DAI_PIN8 to SRC0_FS_IP

    SRU (LOW, PBEN08_I);

    SRU (DAI_PB08_O, SRC0_FS_IP_I);


    //Generating Code for connecting : DAI_PIN8 to SRC1_FS_OP

    SRU (LOW, PBEN08_I);

    SRU (DAI_PB08_O, SRC1_FS_OP_I);


    //Generating Code for connecting : DAI_PIN8 to DAI_PIN14

    SRU (LOW, PBEN08_I);

    SRU (HIGH, PBEN14_I);

    SRU (DAI_PB08_O, DAI_PB14_I);


    //Generating Code for connecting : SRC0_DAT_OP to SPORT0_DA



    //Generating Code for connecting : SRC1_DAT_OP to DAI_PIN9

    SRU (HIGH, PBEN09_I);

    SRU (SRC1_DAT_OP_O, DAI_PB09_I);