FSRW 2.6 versus upper 32K of EEPROM for storage. Speed compare
Don M
Posts: 1,652
Which method would most likely be faster for storing say 24K of data? Faster as in throughput...
Comments
For 24K, I suspect that an SD card will be faster than EEPROM.
Can you share a bit more on what you plan to do?
Do you care only about write speed, or read speed, or both?
Will you have 24K in memory all at the same time, or will it come in at a steady pace and you
want to log it persistently?
I'm pretty sure fsrw can write that much data (48 blocks) very quickly, but a lot depends on
how exactly you write it. If you pwrite() 512-byte chunks, and use the normal (fast) SPI driver
I think your throughput can easily exceed a megabyte a second.
Will stuttering (the occasional block that takes longer to write) be a problem? Because SD
cards can "stutter" sometimes due to their internal firmware . . .
-tom
What I did to check for the "hiccups" in writing was to place in my code some "markers" that would produce a pulse on the logic analyzer so that I could monitor the data being read along with how long it took for the SD write routine to complete. What I found was that near the very beginning of writing to the SD card I would get one instance where the write took around 80 - 90 ms. My data receiver would be interrupted but the receive buffer would more than handle that delay and once the interruption was over then everything went back to normal. All the subsequent writes to the SD card only took .435 ms. Very fast. I let it run this program for 8 minutes of data collection which produced an SD file of 128K and it never missed a beat.
Here's my code:
buf1 is a 520 word buffer. The "markers" I used were P7 & P8 in the code. I would set them before the routine then reset them after.
The first one shows a long hiccup writing to the SD card. This hiccup was about 22ms long. It was the second write from the beginning of logging. You can also see in line 3 right after the SD write is done the 2 blips indicating writing to the buffer buf1. These will normally appear right after the data is valid as in the next 3 to the right of them. This doesn't seem to affect the data collection at all.
The second here shows a typical SD write speed of .435ms. You can see that it barely interrupted the writing of data to buf1 after it completed writing to the SD card.
If there are any improvements that anyone can suggest I'm all ears.