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.

Timer triggered DMA, iterating through an array



I would like to use DMA and timer interrupts to do the following:


Every X number of cycles, update a memory location with the next value in an array.

Ex. data = {1,2,}

timer triggers, DMA transfers 1 to destination ... timer triggers again, DMA transfers 2 to destination ... and so on.

Is this possible exclusively in hardware? Basically, is there a way I can set up the DMA controller to only transfer one value at a time, and then wait until it is retriggered to transfer the next value in an array?

  • Hi Matthew,

    It is always a good idea to provide the specific MSP device name on forum posts so that we can assist you in the best way possible. Luckily from your previous post I can deduce that we are talking about the MSP432P401R.

    Once a DMA service is triggered it will immediately perform the number of transfers requested in succession. Source and destination addresses, if initialized to increment, are also reset to their initial value upon each new DMA service request. Therefore if you would like only one DMA transfer on each trigger then the DMA size should be set to one with a DMA ISR used to change the source address to take in the next value of the array on the following trigger. Of course I see your frustration as this seems to defeat the purpose of using the DMA for your application, generally DMA usage is avoided for minimal transfer tasks such as this.

    Regards,
    Ryan

  • Hi Ryan,


    Thank you for your informative response. I suppose the same rationale applies to DMA transferring from the ADC memory locations?


    I.e., I sample the ADC, DMA grabs the value at ADCMEM0 and stores it into an array. I sample again, and DMA grabs the value at ADCMEM0 and stores it into the next location in the array.


    Is this possible in hardware? Doesn't seem like it, though I have some backup plans if not.

  • Hey Matthew,

    The answer is as above, the source may not change but the destination does so the same logic applies.

    Regards,
    Ryan

**Attention** This is a public forum