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:50] – ktokarz | en:multiasm:cs:chapter_3_13 [2025/12/12 09:47] (current) – ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== DMA ====== | ====== DMA ====== | ||
| - | Direct memory access (DMA) is the mechanism for fast data transfer between peripherals and memory. In some implementations, | + | Direct memory access (DMA) is the mechanism for fast data transfer between peripherals and memory. In some implementations, |
| - | Peripheral device reads/ | + | |
| - | No program execution | + | |
| - | Faster data transfer. | + | |
| - | Buses are controlled with DMA controller. | + | |
| - | No processor RD or WR cycles. | + | |
| - | < | + | The DMA controller is a specialised unit which can control the data transfer process. It implements several channels, each containing the address register, which is used to address the memory location and a counter to specify how many cycles should be performed. The address and counter registers have corresponding temporal address and counter registers updated after every single transfer. The address register and counter must be programmed by the processor. It is usually done in the system startup procedure. The system with an inactive DMA controller is presented in Fig.{{ref> |
| - | {{ : | + | |
| - | < | + | < |
| + | {{ : | ||
| + | < | ||
| </ | </ | ||
| - | Single | + | The process of data transfer |
| - | One transfer | + | * peripheral signals the request to transfer data (DREQ). |
| - | Block (burst) | + | * DMA controller forwards |
| - | Block of data at the time | + | * The processor |
| - | On-demand | + | * DMA controller generates the address on the address bus and sends the acknowledge signal to the peripheral (DACK). |
| - | As long as I/O device | + | * Peripheral sends the data on the data bus. |
| - | Cycle stealing | + | |
| - | One cycle DMA, one CPU | + | * DMA controller updates the address register and the counter. |
| - | Transparent | + | * If the counter reaches zero, data transfer stops. |
| - | DMA works when CPU is executing instructions | + | |
| - | Memory-to-memory | + | Everything is done without any action of the processor. No program is fetched and executed. Because everything is done by hardware, the transfer can be done in one memory |
| - | Memory-to-peripheral | + | |
| - | Peripheral-to-memory | + | <figure DMAactive> |
| - | Peripheral-to-peripheral | + | {{ : |
| + | < | ||
| + | </ | ||
| + | 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. | ||