Shop OBEX P1 Docs P2 Docs Learn Events
sdcard vs datalogger — Parallax Forums

sdcard vs datalogger

mosquito56mosquito56 Posts: 387
edited 2009-06-19 21:13 in Propeller 1
· I purchased a datalogger from parallax many moons ago but never hooked it up.
I have been using fsrw extensively with the sdcard from ucontroller.

I am adding a keypad to the program and have found that for some reason the sd card files are corrupting. I have a couple ideas on this but then I saw the datalogger.

Has anyone used both of these items and have a preference? I think the datalogger would be easier to externally mount than the sd card.

Any thoughts?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······

······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········

Comments

  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2009-06-16 23:53
    I guess the choice of SD or a data logger like devices depends on the needs of the project.

    Recently I too was contemplating the differences and which one to use. Actually I haven't decided, but the project is back on the shelf for the moment. The data logger may free up a cog or two or make your code a bit smaller or simple where as with the SD card you have to manage more within the code (I think) for file reading/writing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter, E.I.
    www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
    www.tdswieter.com
  • rokickirokicki Posts: 1,000
    edited 2009-06-17 05:59
    Sorry to hear you're having difficulties with the SD cards.

    One thing to consider is changing the order of the objects in your top level.
    If the symptoms change, it's probably a difficulty with memory being
    overwritten.

    Let me know if I can help.
  • mosquito56mosquito56 Posts: 387
    edited 2009-06-17 15:14
    The sd card problem has to be software related. When I add new code which has nothing to do with card one particualar file is corrupting. Makes no sense so I will keep plugging away.

    · Judging by the response not to many people are using the datalogger but I am beginning to look at storing my settings on eeprom and just using the card to load up the eeprom.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·······

    ······· "What do you mean, it doesn't have any tubes?"
    ······· "No such thing as a dumb question" unless it's on the internet
    ········
  • pgbpsupgbpsu Posts: 460
    edited 2009-06-17 19:06
    @mosquito56

    I've corrupted many a test file on SD and in every case, I've found the cause to be me or my code, but never rockiki's object. One thing to watch is that you close any open files before pulling the card or before opening another file. You should also avoid pulling the card while it is being written to. The other gottcha I've found is to remember that you can't have more than 512 files in the root directory (or any individual directory I think, but I only use the root directory with the prop and SD cards). This will do more than corrupt a file it will make the disk unreadable. Your data is probably still there but the table of contents are messed up so your computer won't know how/where to find it. I'm not sure if this is a FAT16 or object restriction, but I avoid it by keeping track of the number of files on the disk and if it reaches 500, I simply stop trying to write to it.

    p
  • SapiehaSapieha Posts: 2,964
    edited 2009-06-17 20:11
    Hi pgbpsu.

    It is only root directory that have 512 limit. It is physical limit of HD's logical structure. And no mater if it is files else Directorys You store in it it has same limit
    Driectory's and Subdirectory's not have that limit (Them like standardfiles) only stored information on them like Root directorys and You cant store that many File positions You ned.
    One problem in that structure is if You have more that 512 files stored in this it is very slow in seek after Yours desired file.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • Ole Man EarlOle Man Earl Posts: 262
    edited 2009-06-17 20:14
    Remember all SD cards are NOT created equal !
  • mosquito56mosquito56 Posts: 387
    edited 2009-06-19 15:24
    Looks like the majority of people are using the sd card. I can't seem to get any info on the datalogger.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·······

    ······· "What do you mean, it doesn't have any tubes?"
    ······· "No such thing as a dumb question" unless it's on the internet
    ········
  • David BDavid B Posts: 592
    edited 2009-06-19 18:18
    I made a propeller powered GPS SD datalogger using rokiki's code.

    While I was developing it, I've corrupted both individual files and once the entire filesystem on the SD card so I had to reformat, but in every case, the reason was failing to close a file.

    As long as I've closed the open file, I've never had a problem.
  • rokickirokicki Posts: 1,000
    edited 2009-06-19 21:13
    So a high candidate for the next release is some capability to autoflush the metadata so this doesn't happen.

    I'm a bit surprised, though. I'll have to try this out. Specifically, not closing a file shouldn't corrupt the file
    system; it should just mean the file doesn't have the (or perhaps sometimes *any*) data. I may need to
    try to reproduce this (intentionally *not* closing a file) and see what happens.

    Welcome, lonesock, to my world. smile.gif
Sign In or Register to comment.