I’m not going to tell you how to get DMA working on your system, I don’t know your processor. Instead, my goal is to give you some insights into h

Introduction to DMA

submited by
Style Pass
2024-11-01 15:00:06

I’m not going to tell you how to get DMA working on your system, I don’t know your processor. Instead, my goal is to give you some insights into how DMA works and why we use it to make our systems faster. By the way, DMA spelled out is direct memory access, that part will make sense soon.

Let's say you have a system that needs to transfer data from place to place. In fact, let's say you have this monitoring system, though the details aren't important. The data from the ADC goes to SPI to an SD card and to the computer via USB. The UART is used for command handling.

While there are lots of boxes, the processor (inside the box) here is doing very little. It gets busy when an ADC interrupt comes and data has to flow through the system.

The hardest thing the processor has to do is copy the data from place to place. But copying things from place to place is a silly thing for a processor to do. I mean, the processor copies data from one place to another. The CPU touches each and every byte. But, it doesn’t have to.

If we wanted to use the processor for something useful (such as analyzing this pile of data), we could offload copying into the magical technology of DMA.

Leave a Comment