AnsweredAssumed Answered

2D DMA on BF561

Question asked by Laz on May 11, 2010
Latest reply on May 12, 2010 by Laz

Hello;

 

I am using 2D DMA with the PPI port to read camera data.  Everything is working fine (that wasn't so easy), but I'm confused about one item.  The Current Y Count register doesn't go to zero, it stops at 1, when DMA_DONE is set.  I had to set the Y_COUNT to LINES_PER_FRAME-1, or _DONE is never set.  I don't seem to get the last line from the camera, but if I set the LINES_PER_FRAME to V_SIZE+1, the vertical alignment is off.

 

DMA1_0_CURR_X_COUNT = 0

DMA1_0_CURR_Y_COUNT = 1

 

What does this mean, and how do I manage it?

 

TIA

Dan

 

code:

*pDMA1_0_X_COUNT = (PIXEL_PER_LINE*2)/DMA_COUNT_DIV; //nps; 2 samples per pixel (luma/chroma)
*pDMA1_0_Y_COUNT = LINES_PER_FRAME-1;     // lines per frame from the sensor
*pDMA1_0_X_MODIFY = X_MODIFY;      // Modifier 4 because of 32-bit DMA mode
*pDMA1_0_Y_MODIFY = Y_MODIFY;      // Modifier 4 because of 32-bit DMA mode
*pDMA1_0_START_ADDR = &cameraBuffer;      // Destination address of the image
*pDMA1_0_CONFIG =   DMA2D | WDSIZE_32 | WRITE;

*pPPI0_FRAME = LINES_PER_FRAME; //The PPI is set to receive X lines per frame
*pPPI0_COUNT = PPICOUNT;  //The PPI is set to stop receiving after X number of samples for each liene

*pPPI0_CONTROL = PPICTRL_DLEN8 | PPICTRL_DMA32 | PPICTRL_PACK | PPICTRL_NON656 | PPICTRL_RX;

 

*pDMA1_0_CONFIG |= DMAEN | DI_EN; // | DMA enable
ssync();

*pPPI0_CONTROL |= PORT_EN; // | Start PPI
ssync();

 

// dgl test wait for DMA to complete
while ((*pDMA1_0_IRQ_STATUS & DMA_RUN) != 0); // running
tempX = *pDMA1_0_CURR_X_COUNT;
tempY = *pDMA1_0_CURR_Y_COUNT;

Outcomes