IntermediateTopic 70 of 104Electronics & Embedded

DMA

Direct memory access moves data without CPU involvement.

In depth

DMA controllers move data between memory and peripherals without CPU involvement, interrupting only when finished or half done. Frees CPU for processing and enables high-throughput ADC, SPI and audio. Circular buffers allow continuous streaming; watch cache coherence.

Key points

  • Channels and priorities
  • Double buffering
  • Burst transfers
Example

An I²S audio stream is fed by DMA to a codec.

Why it matters

DMA moves data between peripherals and memory without the processor, which frees the CPU for other work and keeps high data rates manageable.

Where this is used

  • Streaming ADC samples directly into a buffer without interrupts for each sample.
  • Sending a large display image from memory to an LCD controller.
  • Transferring audio samples continuously to a DAC.

Frequently asked questions

What is DMA?

Direct memory access moves data without CPU involvement.

Why is it important to understand DMA?

DMA moves data between peripherals and memory without the processor, which frees the CPU for other work and keeps high data rates manageable.

What is a DMA controller?

A hardware unit that performs memory transfers on request from peripherals, using its own address and count registers.

Why can DMA cause problems?

Cache coherence and buffer overwrites can cause corrupted data if the CPU and DMA access the same memory without synchronisation.

How is DMA used in practice?

Typical applications include streaming ADC samples directly into a buffer without interrupts for each sample, sending a large display image from memory to an LCD controller and transferring audio samples continuously to a DAC.

What should I learn before DMA?

Study "ADC peripherals and sampling" first (topic 69 of 104 in Electronics & Embedded). It covers the groundwork this topic builds on.

What are the key points of DMA?

Channels and priorities. Double buffering. Burst transfers.

Can you give an example of DMA?

An I²S audio stream is fed by DMA to a codec.

What comes after DMA?

The next topic is "Embedded C programming", which builds directly on this one.

How difficult is DMA?

It is classed as Intermediate in Electronics & Embedded (topic 70 of 104). It is an intermediate topic. Work through the beginner topics in Electronics & Embedded first.

Learning path

Want to practise? Open the interactive course for quick checks, quizzes, simulations and progress tracking.