benefit and limitations DMA

Thread Starter

MTech1

Joined Feb 15, 2023
181
I have never used DMA feature of microcontroller but trying to understand it's benefit and limitations Can you elaborate on a specific scenario or application where the implementation of DMA in an embedded system provided significant performance improvements or efficiencies?
If you ever used in project What were the key challenges encountered during the integration, and how were they addressed?
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
You can address & access memory bypassing the processor, Mostly for speed.
I have never found the need, personally, using a high clock rate, especially.
 

Papabravo

Joined Feb 24, 2006
22,058
DMA is traditionally used when there is a large volume of data that needs to be moved which would burden the processor by having it do character by character transfers. An example would be Ethernet(10BaseT) which has a maximum packet size of 1520 bytes. It is way more efficient to work with complete frames instead of character by character. A tape or a disk drive would be another example of potentially large sector or record size that would consume processor resources on repetitive data transfer tasks. Much better to do this on a sector or record basis. As the byte transfer rates go up on various technologies the use of a processor becomes more challenging.

Originally there were not many embedded systems that needed DMA because of the limited RAM. All bets are off now with newer embedded systems with substantial available RAM.
 

nsaspook

Joined Aug 27, 2009
16,252
I have never used DMA feature of microcontroller but trying to understand it's benefit and limitations Can you elaborate on a specific scenario or application where the implementation of DMA in an embedded system provided significant performance improvements or efficiencies?
If you ever used in project What were the key challenges encountered during the integration, and how were they addressed?
I use DMA as the standard method (a must have requirement even of 8-bit controllers designs) of updating information displays (LCD, GLCD, etc..) from a controller internal screen buffer to the display device or when serial data speeds are high (like 460kbps TTL serial transfers) The major issue with most controllers is memory bandwidth/speed. One DMA device on the memory bus will hog the bus unless there is some sort of sharing arbitration hardware. Most 8-bit devices have primitive arbitration hardware so it's a good idea to have mainly CPU bound tasks running on the CPU when DMA is active.
8-bit https://onlinedocs.microchip.com/pr...tml?GUID-7F322DA3-6BD0-4D0C-AFBB-014970CD0FDA
32-bit https://microchipdeveloper.com/xwik...it-mcu/PIC32/mz-arch-cpu-overview/system-bus/

https://www2.ece.ohio-state.edu/~zheng/ece5362/lecture-notes/Lectures23_24.pdf
 

BobTPH

Joined Jun 5, 2013
11,465
I used it in a not very successful attempt to make a storage scope front end for an analog scope. I used DMA for sampling the input as well as sending the output to a DAC. it worked, but just very well and was not particularly useful.

DMA was essential to getting the most speed I could.
 
Top