Re: Understanding DMA
From: Rufus V. Smith (nospam_at_nospam.com)
Date: 03/24/05
- Next message: Eric Smith: "Re: Understanding DMA"
- Previous message: Tanmay Zargar: "Re: Software UART for WindowsXP"
- In reply to: steve: "Understanding DMA"
- Next in thread: Eric Smith: "Re: Understanding DMA"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 24 Mar 2005 15:41:12 -0500
"steve" <mister.steve.smith@gmail.com> wrote in message
news:1111694057.215005.29810@f14g2000cwb.googlegroups.com...
> What I understand about DMA is that the CPU is idle during DMA cycles.
> If this is true whats the use of DMA. I cant find the advantage of
> 'offloading' the data transfer to the DMA controller if the CPU cant
> use that time to do something else . My 2nd question is : Lets assume
> that the CPU is not idle during DMA cycles. In that case, the cpu cant
> access memory so it cant fetch instructions/data so how does it do
> useful work?
> thanks
Your understanding is only partly true. The CPU doesn't necessarily have
to be idle during DMA cycles, just not contending for the bus. And this
doesn't happen for the entire data block, just byte by byte (or word by
word, or whatever burst your system uses).
Typically DMA cycles fit "in between" CPU memory access cycles. CPUs do
other things besides reading and writing to memory, particularly ones
with onboard cache (although this raises other issues about mem. access).
Of course, if you are the system designer, you design memory access in
pages,
such that you are DMA-ing into one page while the processor code runs in
another, and avoid conflicts completely.
DMA does also not necessarily run at processor speed. You could have a
device that is delivering, say, 1 byte per microsecond, while your cpu
is on a 100ns clock. You may get several instructions between DMA
accesses. Use this time for "useful" work.
You can google for more info.
Rufus
- Next message: Eric Smith: "Re: Understanding DMA"
- Previous message: Tanmay Zargar: "Re: Software UART for WindowsXP"
- In reply to: steve: "Understanding DMA"
- Next in thread: Eric Smith: "Re: Understanding DMA"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|