This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DMA copy method

Dear all,

I am facing the following problem and can not find an answer:

Assume I have a data source containing  2*n elements L1 R1 L2 R2 ... Ln Rn (Li and Ri are positioned alternatively), I wish to use DMA to copy this source to a destination to get the result as L1 L2 ...Ln R1...Rn (Li and Ri are put in groups/arrays continunously). Could any of you please guide me how to do this, or just give me some clues or reading sections. I would appreciate it much

I would like to thank you in advance

Nguyen Anh Duc

  • When looking at the way DMA work in general, I found that this problem can be solved by using 2-D to 1-D transfer or vice versa.  However, it seems that this working mode is supported only in EDMA, not in DMA in C5000,

    Can any of you verify it  or have any suggestion? I would be very grateful for it,

    Nguyen Anh Duc

  • Dguyen Anh Duc, 

     Which processor are you using?  The DMA controller is a peripheral, not a general part of the C5000 CPU, so the specific part matters.

    In general, however, what you suggest can easily be done with either two passes (copying half at a time) or using two DMA channels simultaneously.  Just set the source address to increment by 2, and the destination address to increment by 1.

    Regards,

    Bill

     

     

     

     

  • Dear Bill,

    Thank you for your kind response. I am using C5509A. I have got your guidance to my problem.

    However, my problem is a bit more complex. That is I have system with components interconnect as: codec AIC23 <-> DMA <-> C5509A

    At each sampling instant ( 8 kHz), AIC23 sends two 16-bit samples for left and right channels, these samples are copied to a specific memory region using DMA. C5509A will wait to have N consecutive left (or right) samples as a frame to process. Normally, I configure DMA to copy 2N samples both left and right (N sample instants) and then rearrange to get N left samples in a row (DSKC5509 comes with an example named dsk_app doing things completely as presented) . But I am wondering if there is a way with DMA that I do not have to do rearranging,

    I will try your way to solve this problem, if you have any idea please kindly let me know 

    With best regards,

    Nguyen Anh Duc