Post Go back to editing

How to de-Interleave data via 2D DMA due to primary and secondary datapaths of SPORT?

Category: Hardware
Product Number: adsp-21569
Software Version: CCES-2.11

Hello,

I connect two TDM8 stream to primary and secondary data paths of SPORT0 on ADSP-21569. 

Is it possible to de-interleave data using 2D DMA as data is interleave due to primary and secondary data paths.

It will be helpful if one provide a reference code on this topic.

Regards,

Mussab 

  • Hi,

    Please refer the attached example which enables primary and secondary data paths of SPORT with 2D DMA. SPORT_TDM_Mode.zip
    Let me know if any assistance required.

    Regards,
    Divya.P

  • Hi Divya,

    Thank you for a reference code. 

    In code, I am not able to find where Multichannel configuration is set like window size (spt_mctrl register) and active channels (spt_cs0 register).

    Can you also explain how de-interleaving works in this example code?

    Regards,.

    Mussab 

  • Hi Mussab,

    SSLDD 3.0 Device Drivers support the static configuration of the peripherals i.e. users can provide the required configuration parameters beforehand so that device driver can configure the peripheral in the initialization API. Static configuration header files contain set of configuration macros which device drivers use to configure the peripheral.

    Please refer adi_sport_config_2156x.h file available in Project > system > drivers > sport which configures the channel select and Mutichannel Control register.

    Shared example configures to data transfer between SPORT, so Interleave and De-Interleave taken care by DMA.  If this doesn’t help, can you please explain your requirement in detail.

    Regards,
    Divya.P

  • Hi Divya,

    Thanks again for your response.

    I have a specific need. I used two TDM8 lines (total 16 channels). One TDM8 line connected to primary and 2nd TDM8 line connected to secondary data path of SPORTA0 .

    With 1D DMA, i am able to get data L1 memory in following way

     1P, 9S, 2P, 10S, 3P, 11S, 4P, 12S, 5P, 13S, 6P, 14S, 7P, 15S, 8P, 16S, 1P, 9S ................. 8P, 16S.     (P = primary ,S = Secondary, Num X = channel)

    I would like to arrange it via 2D DMA in following  order but could not succeed

     1P, 2P, 3P, 4P, 5P, 6P, 7P, 8P, 9S, 10S, 11S, 12S, 13S, 14S, 15S, 16S, 1P, 2P,........, 15S, 16S.

    How can i get this? As I see if i define XModify = 4, it will recieve one primary and one secondary data consecutively.

    Any help will be appreciated.

    Regards,

    Mussab 

  • Hi Mussab,

    Thank you for sharing the details.
    We are looking into this and get back to you as soon as possible.

    Regards,
    Divya.P

  • Hi,

    As we mentioned when using DMA with primary & Secondary channels enabled, the destination DMA buffer is filled with primary channel data to be followed by the secondary channel data and so on.

    If you need in below format, please refer the attached example. In this example, 2 TDM lines connected to SPORT primary and secondary lines. Then, DMA channel alternately reads from the primary and secondary receive data buffers and interleaves them in the DMA buffer.
    Another buffer is used to store in the below order from the DMA buffer.
    1P, 2P, 3P, 4P, 5P, 6P, 7P, 8P, 9S, 10S, 11S, 12S, 13S, 14S, 15S, 16S, 1P, 2P,........, 15S, 16S.

    Hope this helps.Audio_Loopback_TDM.zip

    Regards,
    Divya.P

  • Hi Divya,

    Thanks for your support.

    I would like to use DMA to arrange data in specific order instead of copying from one buffer to other to save core cycles.

    It looks like DMA not able to arrange data in that specific order. 

    Regards,

    Mussab 

  • Hi Mussab,

     

    Yes, your understanding is correct. Please refer "DMA Transfers" in SPORT chapter in the below linked HRM for more information.

    https://www.analog.com/media/en/dsp-documentation/processor-manuals/adsp-2156x_hwr.pdf

     

    Regards,

    Divya.P