Cancel ongoing DMA transaction

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0



I'm currently using an Atxmega128A4U for a project. One of the things, this controller has to do is the following:


- Send 20 Bytes over UART to a external device

- Receive 40 Bytes over the same UART from the device 


If the Answer of the device takes longer than 200 ms, then the Uart has to send the same 20 Bytes again. having a problem with that. I only have only one DMA Channel left, so I have to do transmit and receive on this single channel. Everything works fine as long as the device sends 40 bytes within the 200ms. If a few bytes are missing and the DMA is still running when configured to TX operation, the DMA Channel detects an Error. This happens because I stop the channel by resetting the CHEN bit. This Error causes the other DMA Channels to stop for a short time, which is a problem because they're quite time critical. 


So my question: Is there a safe way to stop an ongoing DMA transaction? 



Greetings from Germany,