Shop OBEX P1 Docs P2 Docs Learn Events
SD routine questions (FSRW) — Parallax Forums

SD routine questions (FSRW)

BasilBasil Posts: 380
edited 2014-03-05 13:58 in Propeller 1
Hi All,

Hoping those with experience can help me pick an SD routine from the obex as there are a few to choose from.

I need to log 34k bits per second from various sensors, formatted as raw data to save space. Folders not required but multiple files are (new file for each session).

High g's and vibration will be experienced so the resilience to work through brief interuptions would be super (100ns interuptions)

Edit:
Forgot to say, instead of raw data, human readable CSV files would be super, but I am unsure of the data rate which can be achieved.

Comments

  • msrobotsmsrobots Posts: 3,709
    edited 2014-03-02 18:05
    If you do not need directory support use FSRW. It Is way faster. For multiple file Include multiple times, an just mount the first one.

    Enjoy!

    Mike
  • SRLMSRLM Posts: 5,045
    edited 2014-03-02 18:35
    Basil wrote: »
    Hi All,

    Hoping those with experience can help me pick an SD routine from the obex as there are a few to choose from.

    I need to log 34k bits per second from various sensors, formatted as raw data to save space. Folders not required but multiple files are (new file for each session).

    High g's and vibration will be experienced so the resilience to work through brief interuptions would be super (100ns interuptions)

    Edit:
    Forgot to say, instead of raw data, human readable CSV files would be super, but I am unsure of the data rate which can be achieved.

    FSRW will be your best bet, although I don't think any SD solution will work with your brief interruptions. When used in high shock environments the SD card contacts can momentarily lose contact, corrupting file and ruining the entire recording. You'd be much better off writing to onboard flash memory.
  • BasilBasil Posts: 380
    edited 2014-03-03 11:55
    Hi All,

    That is as I have discovered. I have been playing around with FSRW in my program and it seems to have all I need. Throughput is high enough it seems, but I have a question about that also :)

    I haven't delved too deep into its code, and its been a few years since picking up the prop again yesterday so i'm a little rusty and not sure i'd be able to interpret it anyway just yet.
    I plan to run my clock as low as possible to reduce battery consumption.

    Is the 800kB/s ive seen floating around based on 80Mhz, or is it irrespective of clock speed?

    I will be writing data in bursts to reduce the risk of data corruption. I will be writing 1 seconds worth of data (about 6.5k Btyes) every second. I figure this will only take around 5-10ms at 800kB/s and the SD card will be idle for time between writes.
    Data will be written as human readable text in a .txt file
    The high g's will only occur once or twice per session, and only for a fraction of a second.

    Does fsrw perform any data checking after each write? I have time enough to read back the data and resend if required. Is this possible?

    Thanks!
  • SRLMSRLM Posts: 5,045
    edited 2014-03-03 12:22
    When the SD card loses contact the FAT system is corrupted. FSRW will happily continue writing to the disk in the (previously) correct memory location, but you'll end up with a 512 byte file. You can examine the disk and see that your information is still there, but it's not accessible via the file system. FSRW does not perform any checking.
  • BasilBasil Posts: 380
    edited 2014-03-05 13:58
    Weird, I was sure I replied to this...

    Anywho, I was thinking I could use a 24LC1025 instead of the little 32K EEPROM and hold the data in it until i'm past the high G's and vibration (which only lasts a short time) then copy it over to the SD.

    EDIT:

    Instead of the 24LCxxxx family of EEPROMS, can I use something like the 2MBIT M24M02-DR (http://www.st.com/web/en/resource/technical/document/datasheet/CD00290537.pdf)
    I have not been able to find a direct answer, though i'm sure there is one out there. Im thinking no due to differences in read/write commands but hoping yes?
Sign In or Register to comment.