07-26-2007 09:55 AM
Hi eesen-
I would expect the DMA query to take longer than the FIFO query. The difference in timing is likely due to the fact that the dma->read() process requires multiple register accesses and other processing to determine whether bytes are available in the buffer. The FIFOData polling method only requires a single register access, so it is expected to be much faster.
So why is DMA still better you might ask? This is because each FIFO polling read requires CPU-controlled register accesses. DMA, on the other hand, has slightly more overhead at the beginning (i.e. in your experience, <1uSec for polling a single point and >5uSec for the DMA method) but results in much better performance overall.
Let's say you're reading 1000 points. The polling method would require something like 1000 * 0.11uSec = 110uSec. DMA on the other hand would require something like 2 * 7uSec = 14uSec (since two calls to dma->read() are necessary to complete the DMA transfer). Given this, the overall read process using DMA is clearly better.
Hopefully this helps-
07-27-2007 03:13 AM
07-27-2007 08:12 AM
Hi eesen-
Is this the time that it takes the entire read() loop to execute? What sampling rate are you using?
07-30-2007 09:45 AM
This measured time values are only for single dma->read() function.
Sample rate is 1khz
08-09-2007 03:21 AM
08-09-2007 10:34 AM