Post Go back to editing

ADSP2159 SPORT TDM Mode Problem

Category: Software

I have two half SPORT(SPORT0A and SPORT1A) configure as multichannel mode RX, each has 16channels,the window offset of SPORT0A is set to 896,another SPORT set to 0,so I can receive two TDM channels data at the same time,SPORT configuration as follows:

the sport1A callback function can get called,but sport0A callback function didn't get called,How to solve it?



change picture
[编辑人: elker_829238 编辑时间: 12 Apr 2024 3:38 AM (GMT -4)]
  • Hi,

    The SPORT_MCTL_A.WOFFSET bits to select the start location for the half SPORT's active window of channels within the 1024-channel range. As you are using different SPORTs, can you please check with same window offset for both the SPORTs instead of 896 and let us know if that works.

    Is it possible for you to share the simple code to replicate the issue in our side?

    Regards,
    Ranjitha.R

  • hi

    with the same window offset for both halfSPORT ,it's ok.

    but with different window offset for both halfSPORT, as long as window offset less than 16,it's ok too.

    with the same window offset but greater than 15,it's not ok.

  • Hi,

    Can you please share more information about your application. Also, please let us know more about your transmitter. Are you using single transmitter or multi transmitter, so that we can assist you better on this.

    Regards,
    Ranjitha.R

  • hi,

    I use halfSPORT0B and halfSPORT1B as transmiter, halfSPORT0A and halfSPORT1A as receiver.SPORT initialize as follow:

    static int Sport_Init()
    {
    /* SPORT return code */
    ADI_SPORT_RESULT eResult;

    /* Open the SPORT Device 0B */
    eResult = adi_sport_Open(SPORT_DEVICE_0B,ADI_HALF_SPORT_B,ADI_SPORT_DIR_TX, ADI_SPORT_MC_MODE, SPORTMemory0B,ADI_SPORT_MEMORY_SIZE,&hSPORTDev0BTx);
    CHECK_RESULT(eResult);
    /* Open the SPORT Device 0A*/
    eResult = adi_sport_Open(SPORT_DEVICE_0A,ADI_HALF_SPORT_A,ADI_SPORT_DIR_RX, ADI_SPORT_MC_MODE, SPORTMemory0A,ADI_SPORT_MEMORY_SIZE,&hSPORTDev0ARx);
    CHECK_RESULT(eResult);

    /* Configure the data,clock,frame sync and MCTL of SPORT Device 0B*/
    eResult = adi_sport_ConfigData(hSPORTDev0BTx,ADI_SPORT_DTYPE_SIGN_FILL,31,false,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigClock(hSPORTDev0BTx,32,false,true,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigFrameSync(hSPORTDev0BTx,31,false,false,false,true,false,false);

    CHECK_RESULT(eResult);
    eResult = adi_sport_SelectChannel(hSPORTDev0BTx,0u,15u);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigMC(hSPORTDev0BTx,0u,15u,0u,true);
    CHECK_RESULT(eResult);


    /* Configure the data,clock,frame sync and MCTL of SPORT Device 0A*/
    eResult = adi_sport_ConfigData(hSPORTDev0ARx,ADI_SPORT_DTYPE_SIGN_FILL,31,false,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigClock(hSPORTDev0ARx,32,false,true,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigFrameSync(hSPORTDev0ARx,31,false,false,false,true,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_SelectChannel(hSPORTDev0ARx,0u,15u);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigMC(hSPORTDev0ARx,0u,15u,0u,true);
    CHECK_RESULT(eResult);


    /* Register SPORT Callback function */
    eResult = adi_sport_RegisterCallback(hSPORTDev0ARx,SPORT0ACallback,NULL);
    CHECK_RESULT(eResult);

    /* Prepare descriptors */
    PrepareDescriptors();

    /* Submit the first buffer for Rx. */
    eResult = adi_sport_DMATransfer(hSPORTDev0ARx,&iSRC_LIST_1_SP0A,(DMA_NUM_DESC),ADI_PDMA_DESCRIPTOR_LIST, ADI_SPORT_CHANNEL_PRIM_SEC);
    CHECK_RESULT(eResult);
    /* Submit the first buffer for Tx. */
    eResult = adi_sport_DMATransfer(hSPORTDev0BTx,&iDESC_LIST_1_SP0B,(DMA_NUM_DESC),ADI_PDMA_DESCRIPTOR_LIST, ADI_SPORT_CHANNEL_PRIM_SEC);
    CHECK_RESULT(eResult);

    /*Enable the Sport Device 0A */
    eResult = adi_sport_Enable(hSPORTDev0ARx,true);
    CHECK_RESULT(eResult);
    /*Enable the Sport Device 0B */
    eResult = adi_sport_Enable(hSPORTDev0BTx,true);
    CHECK_RESULT(eResult);

    /* Open the SPORT Device 1B */
    eResult = adi_sport_Open(SPORT_DEVICE_1B,ADI_HALF_SPORT_B,ADI_SPORT_DIR_TX, ADI_SPORT_MC_MODE, SPORTMemory1B,ADI_SPORT_MEMORY_SIZE,&hSPORTDev1BTx);
    CHECK_RESULT(eResult);
    /* Open the SPORT Device 1A*/
    eResult = adi_sport_Open(SPORT_DEVICE_1A,ADI_HALF_SPORT_A,ADI_SPORT_DIR_RX, ADI_SPORT_MC_MODE, SPORTMemory1A,ADI_SPORT_MEMORY_SIZE,&hSPORTDev1ARx);
    CHECK_RESULT(eResult);

    /* Configure the data,clock,frame sync and MCTL of SPORT Device 1B*/
    eResult = adi_sport_ConfigData(hSPORTDev1BTx,ADI_SPORT_DTYPE_SIGN_FILL,31,false,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigClock(hSPORTDev1BTx,32,false,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigFrameSync(hSPORTDev1BTx,31,false,false,false,true,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_SelectChannel(hSPORTDev1BTx,0u,15u);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigMC(hSPORTDev1BTx,0u,15u,0u,true);
    CHECK_RESULT(eResult);


    /* Configure the data,clock,frame sync and MCTL of SPORT Device 1A*/
    eResult = adi_sport_ConfigData(hSPORTDev1ARx,ADI_SPORT_DTYPE_SIGN_FILL,31,false,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigClock(hSPORTDev1ARx,32,false,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigFrameSync(hSPORTDev1ARx,31,false,false,false,true,false,false);
    CHECK_RESULT(eResult);
    eResult = adi_sport_SelectChannel(hSPORTDev1ARx,0u,15u);
    CHECK_RESULT(eResult);
    eResult = adi_sport_ConfigMC(hSPORTDev1ARx,0u,15u,0u,true);
    CHECK_RESULT(eResult);


    /* Register SPORT Callback function */
    eResult = adi_sport_RegisterCallback(hSPORTDev1ARx,SPORT1ACallback,NULL);
    CHECK_RESULT(eResult);

    /* Submit the first buffer for Rx. */
    eResult = adi_sport_DMATransfer(hSPORTDev1ARx,&iSRC_LIST_1_SP1A,(DMA_NUM_DESC),ADI_PDMA_DESCRIPTOR_LIST, ADI_SPORT_CHANNEL_PRIM_SEC);
    CHECK_RESULT(eResult);
    /* Submit the first buffer for Tx. */
    eResult = adi_sport_DMATransfer(hSPORTDev1BTx,&iDESC_LIST_1_SP1B,(DMA_NUM_DESC),ADI_PDMA_DESCRIPTOR_LIST, ADI_SPORT_CHANNEL_PRIM);
    CHECK_RESULT(eResult);

    /*Enable the Sport Device 1A */
    eResult = adi_sport_Enable(hSPORTDev1ARx,true);
    CHECK_RESULT(eResult);
    /*Enable the Sport Device 1B */
    eResult = adi_sport_Enable(hSPORTDev1BTx,true);
    CHECK_RESULT(eResult);

    return eResult;

    }

  • Hi,

    We are checking internally and will get back to you as soon as possible.

    Regards,
    Ranjitha.R

  • Hi ,

    As you mentioned “I have two half SPORT(SPORT0A and SPORT1A) configure as multichannel mode RX, each has 16channels,the window offset of SPORT0A is set to 896,another SPORT set to 0,so I can receive two TDM channels data at the same time”
    >> As Window offset will only decide the delay between FS and the start of active channel. So It wont solve the sync issue/receiving data at the same time, as still the SPORT0A & 1A will have different MMRs and will have some latency between the MMR writes while enabling both SPORTs.
    >> We would recommend to make use of Global sport feature for achieving the use case of syncing/enabling sports at the same time, provided that SPORT-Rx has similar clock/fs/data configs. And use WINOFFSET=0. Please refer to Global SPORT example under SPORT folder in ADSP-2156x BSP path given below. You can refer to SPORT grouping/global section under SPORT & DAI modules in HRM for more data on this.
    [Installation directory]:\Analog Devices\EV-2156x_EZ-KIT-Rel1.0.1\EV-2156x_EZ-KIT\Examples\drivers\sport

    Ideally we have kept WINOFFSET=0 (less than 16) and used it from TDM4/8/16 across most of the products and it was recommended to keep it less than 16 from older designs as well.

    Regards,
    Ranjitha.R