Sport Interface DSP between BF607 and AD7770


I have a DSP BF607 connected to a AD7770 (using one SPI interface for configuration, and one SPORT interface for data acquisition.

SPI Configuration is all good. It is configured in mode 00 (4 DOUT lines enabled, outputing two channels per line).

SPORT configuration is working partially,

AD7770 has 4 datalines, connected to one SPORT, using both dataline (primary and secondary) of both half (A and B).

I have achieved to read the samples from one data line, but no more.(configuring half A and primary channel only).

When enabling the secondary data channel, the application only read sample 0 from AD7770.  

SPORT is in Multichannel mode, with two slot per frame ( primary and secondary channel for one half sport). Is this correct? 

I figure that once I get both channels working, I will use half_mux register so that HALF-B uses HALF-A clock and frame sync.

My question is, what is the proper DSP BF607 SPORT configuration to read AD7770 4 DOUT lines?

Also, how to read the data buffer? If configuration is good, is it possible to use the function adi_Sport_SubmitBuffer() ?

For information, I am using the code example BF609_sport_loopback, which seemed a good starting point.



  • In order to read secondary channel, it seems that it was required to enable the DMA mode... 

    At first, I was calling "adi_sport_IsBufferAvailable()". With this method, I could only read the data on primary channel. When enabling the secondary channel, rxbuffer values were bad.

    I then tried using RX callback function instead of polling. Same bad results.

    Finally, I tried the DMA_MODE,  and success. I can now read both primary and secondary channels from half A and half B.

    My question is:

    is it possible to read secondary channel without enabling DMA mode? If yes, how?



  • 0
    •  Analog Employees 
    on Jan 30, 2020 1:27 PM over 1 year ago in reply to nstjean81

    Hello Normand,

    We are also observing the similar behavior as yours. This is because the sport driver interrupt handler fills the data into the primary channel buffer only. We are working for this issue now. We will get back to you as soon as possible.

    Santha kumari.K

  • After many trials and errors, I figured how to de-interleave the samples from AD7770, interleaved by the merge of primary and secondary channel from SPORT-HALF.

    I would strongly suggest to add figure and/or table to better help understanding of DMA_CONFIG parameters: XCNT, XMOD, YCNT and YMOD.

    Anyway, all is good now.



  • Hi,

    Now that AD7770 samples are de-interleaved (organised in sequence), my next step is to build buffer of samples for each channel (8 channels).

    The buffer will be something like AD7770_buffer[SAMPLE_COUNT x CHANNEL_COUNT]

    I am trying to configure TRU so that DMA Sport trigger the MDMA each time SPORT has de-interleaved incoming samples. The MDMA will be working in 2D buffer, to fill each channel buffer "progressively".

    Does it make sense to try this method? Is there another method that I should go for?

    My main question one again:

    Does Analog Device has a recommendation on how to configure RTU, DMA and SPORT to gather samples from AD7770 continuously, building buffer for each channel in a ping-pong manner, in order to allow signal processing without losing sample?



  • 0
    •  Analog Employees 
    on Feb 7, 2020 6:31 AM over 1 year ago in reply to nstjean81


    Regarding I am trying to configure TRU so that DMA Sport trigger the MDMA each time SPORT has de-interleaved incoming samples. The MDMA will be working in 2D buffer, to fill each channel buffer "progressively"

    >>>Is there any specific reason for using MDMA in 2D mode here? In our audio application, we are using DMA mode in both Rx and Tx side of SPORT and we could able to de-interleave the received samples without using MDMA mode

    If possible please share us code snippet for understanding your requirement better

    Ping-Pong buffering is a programming technique that uses two buffers to speed up a processor that can overlap I/O with processing. Data in one buffer is being processed while the next set of data is read into the other one. The driver internally takes care of switching when a buffer is filled.

    You can refer the Audio examples from ADSP-BF706 Ez-Mini BSP package or ADSP-SC5xxx for submitting buffer in ping-pong manner for processing the signal without losing samples.

    In the audio example code, initially we submit Ping-Pong buffer. But in the SPORT driver, DMA is not configured as chain of descriptors for ping-pong buffers submitted by application. In this case, every time a buffer transmission done, we have to resubmit that buffer again by collecting the processed buffer address in the callback function.

    Please find the attached image which will help you understand how the buffers are processed by DMA controller.

    To generate SPORT trigger to the MDMA after the SPORT has de-interleaved incoming samples, you can use the adi_sport_ConfigTriggerOut() API for configuring Trigger Output settings for the DMA associated with SPORT device.

    Please refer the below CCES path:
    CrossCore Embedded Studio > System Run-Time Documentation > System Services and Device Drivers > ADSP-BF60x API Reference > Modules > SPORT Device Driver

    For initializing and configuring TRU, please refer the TRU example from the below path:
    <installation_path>\Analog Devices\ADSP-BF609_Evaluation_Board-Rel<version>\BF609_EZ-Board\Blackfin\Examples\services\tru

    Santha kumari.K

  • Hi Santha,

    thank you for your reply.

    The reason about using MDMA would be to have the "data handling" done in back ground, so that the application has most of allowed time for signal processing.

    Sampling at 32 ksps, we use buffer of 320 samples x 4 channels (twice, sport half-a and sport haft-b), in other word, we have a 10ms window to crunch the data.

    10 ms seems a lot considering 500MHz clock. But right now, signal processing takes about 70 ms... Signal processing uses many IIR, FIR, FFT calls. Using two cores to split this time in half is planned.

    Last Thursday, I had a call with your FAE. The conclusion of our discussion was to let go the TRU and MDAM, and instead, do the de-interleaving by software sending two large buffers for SPORT DMA ( 4 channel x 320 [samples / channel] x 4 [bytes/samples] ). And to re-submit a new large buffer after each sportCallback().

    I will take a look at the audio example you mentioned above.

    About the 

    rossCore Embedded Studio > System Run-Time Documentation > System Services and Device Drivers > ADSP-BF60x API Reference > Modules > SPORT Device Driver

    It this part of CCES basic installation, or it this from another package? I do not have this folder...

    I will let you you how it goes.



  • Hi Santha,

    BF607 and AD7770 are working fine.

    Thanks for your support,


Reply Children
No Data