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/01/08 21:16] (current) – ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== DMA ====== | ====== DMA ====== | ||
| - | Direct memory access. | + | Direct memory access |
| - | Peripheral device reads/ | + | |
| - | No program execution | + | DMA controller |
| - | Faster | + | |
| - | Buses are controlled | + | <figure DMAinactive> |
| - | No processor RD or WR cycles. | + | {{ : |
| + | < | ||
| + | </ | ||
| + | |||
| + | The process of data transfer | ||
| + | * 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 busses. | ||
| + | * DMA controller generates the address on the address bus and sends the acknowledge signal to the peripheral (DACK). | ||
| + | * Peripheral sends the data by the data bus. | ||
| + | * DMA generates a write signal to store data in the memory. | ||
| + | * DMA controller updates address register and the counter. | ||
| + | * If the counter reaches zero data transfer | ||
| + | |||
| + | 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 access cycle so much faster than by the processor. Data transfer by processor is significantly slower because requires at least four instructions of program execution and two data transfers: one from the peripheral and another to the memory for one cycle. The system | ||
| + | |||
| + | <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 | ||
| + | |||