sdcard vs datalogger
mosquito56
Posts: 387
· 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
········
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
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
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.
· 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
········
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
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·······
······· "What do you mean, it doesn't have any tubes?"
······· "No such thing as a dumb question" unless it's on the internet
········
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.
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.