BF512, PPI, DMA0 and AD7622 adc

I am trying to use System Services to operate an AD7622 A/D converter.  The ADC is connected to the PPI and I have programmed the DMA.  I have connected the AD7622's BUSY signal to the BlackFin's DMAR0 (PG2) pin.  I can not find an adi_dma_Control() command to specify that I am using DMAR0.  Both the PORTG_MUX and PORTG_FER registers have the wrong values.  Here is my initialization code:

- - - - - - - - - -

   ADI_DMA_MANAGER_HANDLE  dmaHandle;

   ADI_DCB_HANDLE          dcbPpiServer;

   ADI_DMA_CHANNEL_HANDLE  pDmaPpiChannelHandle;

   ADI_DMA_RESULT          dma_result;

   ADI_DMA_CONFIG_REG      dma_config_register;


   dmaResult = adi_dma_Init (&dmaManager_workspace, DMA_MGR_WS,

                             &dmaDevices, &dmaHandle,

                             &dmaCriticalRegionArg);

   dma_result = adi_dma_Open (dmaHandle,

                              ADI_DMA_DMA0,   // DMA 0 - default for PPI.

                              NULL,

                              & pDmaPpiChannelHandle,

                              ADI_DMA_MODE_CIRCULAR,

                              dcbPpiServer,

                              copy_buffer);

    /* Circular; Call back on sub-buffer complete */

    dma_config_register.b_DMA2D  = ADI_DMA_DMA2D_LINEAR;

    dma_config_register.b_NDSIZE = ADI_DMA_NDSIZE_STOP;

    dma_config_register.b_WDSIZE = ADI_DMA_WDSIZE_16BIT;

    dma_config_register.b_DI_SEL = ADI_DMA_DI_SEL_INNER_LOOP;

    dma_config_register.b_DI_EN  = ADI_DMA_DI_EN_ENABLE;

    dma_config_register.b_WNR    = ADI_DMA_WNR_WRITE;

    dma_config_register.b_FLOW   = ADI_DMA_FLOW_AUTOBUFFER;

   dma_result = adi_dma_Buffer(pDmaPpiChannelHandle,

                               pingPong,

                               dma_config_register,

                               ARRAY_SIZE,

                               2u,         /* 2 Bytes = 16-bit datum */

                               2u,         /* 2 sub-buffers */

                               0u);        /* Ignored value */

  dma_result = adi_dma_Control (pDmaPpiChannelHandle,

                                ADI_DMA_CMD_SET_DATAFLOW,

                                DMA_ENABLE);

- - - - - - - - - -

I suspect I am NOT doing some needed initialization, but I am stumped.  Any ideas?  Thanks.

Regards,

Fred

  • Hi Fred,

    if you refer HRM for the details about DMARx signals, then you can find that these signals are used in Handshake Memory DMA (HMDMA) peripheral). When PPI is used, it uses perpheral DMA (not MDMA). So, for your AD7622-PPI interface, DMAR feature cannot be used.

    Regarding HMDMA service support in system services, I believe, there is not in SSL 1.0.

  • Hi Fred,

    In that case, FIFO/ADC/DAC should be connected to EBIU of the processor (such that MDMA will be used to read/write the data). These devices should support EBIU timings of Blackfin processor as given in processor's datasheet.

    Typically, ADC will signal Data Ready signal (which will be connected to DMAR pin) when data is ready and based on this signal, MDMA operation with required count will be triggered.

    I have non-ssl example which shows working of HMDMA, but it is just for memory-to-memory transfer...does not involve any external device like ADC. Here is the code attached.

    -Prashant

    Message was edited by: Prashant Gawade

  • Hi Prashant,

       In the BF51x Hardware Reference (82-100109-01) on page 6-4 I found this:

    - - - - - - - - -

    For products with handshaking MDMA (HMDMA), the operation is supported

    by two MDMA request input pins, DMAR0 and DMAR1. The DMAR0

    pin controls transfer timing on the MDMA0 destination channel. The DMAR1

    pin controls the destination channel of MDMA1. With these pins, external

    FIFO devices, ADC or DAC converters, or other streaming or block-processing

    devices can use the MDMA channels to exchange their data or

    data buffers with the Blackfin processor memory.

    - - - - - - - - -

       This seems like exactly what I want to do.  Is there an example schematic and software?

    Thanks,

    Fred

  • Hi Prashant,

       Understood.  And thank you for the example VisualDSP project.

       So in my case, the ADC Data Ready signal gets connected to PPI_FS1 where it is treated as an external trigger.

    Regards,

    Fred

  • Hi Fred,

    Not sure if I explained clearly or not, but we cannot use HMDMA feature (DMARx pin) with PPI DMA. The DMARx pin is associated with MDMA (memory-to-memory DMA).

    To use this feature in ADC/DAC/FIFO, the device should be connected as memory mapped device (so device should support such timings), so that MDMA accesses can be initiated.

    Thanks,

    Prashant