View previous topic :: View next topic |
Author |
Message |
rredding
Joined: 25 Mar 2005 Posts: 63 Location: Tacoma WA
|
Posted: Mon May 09, 2005 4:23 pm Post subject: CF Speed with AVR DOS |
|
|
I have a project where I need to send a continuous stream of 16 bit values to 8 DACs at a rate of 48000 Hz. I plan on using an ATMEGA 128 running at 16MHZ and the DAC is an SPI device. I will need to loop through a large number of values where each DAC will have an independent set of values. Essentially it is to be an 8 channel, synchronized arbitrary waveform generator. The blocks of values may be several megabytes in size for each DAC. I may loop through one set of values in a block N times, then switch to another block for N times, etc. In my application, the processor can be devoted to the data streaming funciton completely. I am considering BASCOM-AVR and AVR-DOS.
So, I suppose my necessary data rate from the CF is roughly 800K Bytes per soecond. Is there someone out there that has used AVR-DOS where data streaming like this is performed? Do I need to set up some sort of buffer to avoid glitches in the data stream? Any other issues I need to bear in mind?
Thank you |
|
Back to top |
|
|
philm
Joined: 14 Jul 2004 Posts: 138 Location: Australia
|
Posted: Tue May 10, 2005 2:20 am Post subject: |
|
|
rredding,
I don't think a data rate of 800kB/s is achievable.
Using a 16MHz clock gives you 20 clock cycles per byte. To get a single byte from the file system buffer (or a secondary buffer) to your SPI DAC will take up almost all the 20 clock cycles, and there is no time left to fill the buffer from any source.
Phil |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Tue May 10, 2005 4:12 pm Post subject: Throughput Compact Flash.... |
|
|
Have done some tests. On a ATA Harddrive controller from www.edtp.com (ATmega128) and a Compact Flash card I got a throughput of 570 kb/sec.
There are some low level routines for writing Harddisk and Compact Flash on my homepage.
Bye
Ben Zijlstra |
|
Back to top |
|
|
rredding
Joined: 25 Mar 2005 Posts: 63 Location: Tacoma WA
|
Posted: Tue May 10, 2005 4:42 pm Post subject: Great feedback, thanks |
|
|
Well, seeing as I only truely need 6 of the 8 available channels of the octal DAC for my app and that I could probably cut back my rate to about half, if I need too, it might all work out. That gives me about 55 cycles per byte and a rate of 288 KB/s which should be workable, if I use low level code. Thank you both for your feedback! |
|
Back to top |
|
|
|