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