Hi, first post so be gentle.
l have a little experience with micro controllers.
I need to store about 150,000 values (24 bit).
I will need to do this many times so EEPROMs are out.
In code, I need to read one 24 bit chunk at a time.
Each read must take less than 200uSec leaving about 800uSec to take care of the calculations. At this time I am guessing that I can get the remaining work done in 800uSec.
The 24bit values are used in code to determine the required control movements.
I am thinking USB stick or microSD to store the data.
The main and first problem I need to solve is getting the next value in less than 200uSec.
Can data be moved from somewhere to a variable at this speed?
What is the best somewhere?
Can this be done with serial reads? (I2C or SPI).
Are there other options?
I do not want to use a computer because any un-controlled interrupts are not acceptable.
Ok, here are my comments:
Firstly as you said, EEPROM is definitely out due to max read/write cycles.
Secondly, I have not seen a microSD implementation with arduino that can read/write data that fast.
I presume you need to store all that data and then recall it all at a later date (to a computer?)
There are some (relatively) new options eg. FRAM that has many more read/write cycles than EEPROM but is non volatile and fast data transfer.
The maximum SPI baud rate is (Fclock / 2) where Fclock is the system clock.
On a 16MHz this would be 8Mbits per second so the data transfer for 24bits
would be 1.5uS. I am not sure latencies for uSD cards or any other overhead.
I would implement a circular buffer with an interrupt routine so that the SPI
port is fully utilized. IIRC the I2C is specified to 400KHz. Check the Atmel
spec on that one.
Battery backed up SRAM may be an option.
(* jcl *)
Thanks for the replies.
I need to digest and do more research on SPI, buffers, etc.
Also, thinking more I am looking at 24 bits in 200uSec.
Is my understanding correct that this is 120,000 bits/sec baud rate?
SPI is 8,000,000 bits/sec baud rate?
COM3 baud rate is 115,200 bits/sec?
Thanks, I will go googling now !!!!
Your calculations look correct.
Don’t forget that there will be other overhead on the SPI port. You need to
toggle enable bits, latch bits, call the interrupt routine, read the buffer state,
(* jcl *)
What a coincidence! I just posted here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1262116516
that I have a few FRAM shields I want to sell.
A 512K board can be had for $65.
The endurance is 1014 write cycles… i.e. you could write repeatedly for 316 years before it would wear out.
And this board can write a 24 bit value in less than 100 micro seconds.