Embedded Systems & Firmware
When a microcontroller captures many A/D conversion results at regular intervals, what is the advantage of using DMA?
- AThe A/D converter's resolution increases automatically
- BThe input voltage is amplified automatically
- CThe CPU need not read each result in an interrupt; DMA stores them in memory, reducing CPU load
Show answer and explanation
Answer: C. The CPU need not read each result in an interrupt; DMA stores them in memory, reducing CPU load
If the CPU reads each conversion in an interrupt, at tens of thousands of samples per second the interrupt overhead alone consumes much of its time. With DMA, each completed conversion is written in turn into an array in memory, and the CPU is notified only when the array is full. Combined with a timer that triggers conversions, precisely spaced sampling continues without the CPU.
- A. Resolution is unchanged.
- B. The voltage is unchanged.
- C. Correct. The CPU can process the data in batches later.