This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:cs:chapter_3_13 [2025/01/08 20:46] – ktokarz | en:multiasm:cs:chapter_3_13 [2025/12/12 09:47] (current) – ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== DMA ====== | ====== DMA ====== | ||
| - | Direct memory access. | + | Direct memory access |
| - | Peripheral device reads/ | + | |
| - | No program execution | + | The DMA controller is a specialised unit which can control the data transfer |
| - | Faster | + | |
| - | Buses are controlled | + | <figure DMAinactive> |
| - | No processor | + | {{ : |
| + | < | ||
| + | </ | ||
| + | |||
| + | The process of data transfer is done in some steps. Let us consider the situation when a peripheral has some data to be transferred. | ||
| + | * peripheral signals the request to transfer data (DREQ). | ||
| + | * DMA controller forwards the request to the processor (HOLD). | ||
| + | * The processor accepts the DMA cycle (HLDA) and switches off from the buses. | ||
| + | * DMA controller generates the address on the address bus and sends the acknowledge signal to the peripheral (DACK). | ||
| + | * Peripheral sends the data on the data bus. | ||
| + | * DMA generates a write signal to store data in the memory. | ||
| + | * DMA controller updates the address register and the counter. | ||
| + | * If the counter reaches zero, data transfer stops. | ||
| + | |||
| + | Everything is done without any action of the processor. | ||
| + | |||
| + | <figure DMAactive> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | DMA transfer can be done in some modes: | ||
| + | * Single - one transfer at a time | ||
| + | * Block (burst) - block of data at a time | ||
| + | * On-demand - as long as the I/O device accepts transfer | ||
| + | * Cycle stealing - one cycle DMA, one CPU | ||
| + | * Transparent - DMA works when the CPU is executing instructions | ||
| + | |||
| + | DMA controllers are implemented in personal computers, but also in advanced microcontrollers and systems on a chip, to support data transfers between internal memory and internal peripherals. | ||