Go Down

Topic: sdfat vs. sd (Read 2788 times) previous topic - next topic

MilkyWay

Hi everybody,

I'm a newbie to all of this, but I'm doing a rainfall measurement project and I need to collect and store data quickly with Arduino

What's the difference between the SDfat library and the regular SD one that came with the Arduino program? I've got both of them, and SDfat library seems to be more involved but is also associated with some posts on storing data quickly. Is one better than the other to use?

fat16lib

I am the author of SdFat.  SD.h is a wrapper for an old version of SdFat that provides an alternative API.

SD.h works well for most people.  It has bugs but these don't affect most people.  Most users don't need the features or higher performance of SdFat so SD.h will probably work fine for you.

So the SD library included with the Arduino IDE is SdFat with a simple API that reduces features but makes the library easy to understand and use.  The new SdFat is also easy to use for simple sketches but has a different API.

Loudhvx

Well, I can definitely confirm SDfat is much faster than SD.h.  I was saving somewhere around 14 samples per second using SD.h, but with SDfat I'm somewhere around 500 per second.  There may be a case of apples-to-oranges since I'm not sure I was saving the same thing in both situations, but the difference is still amazing.  I have a few questions about reading with SDfat, but I'll have to organize my questions better before asking.

SDfat is a project-saver, fat16lib! Thanks! 

Osgeld

my experience, sdfat works, sd doesn't

3 cents (thats a bonus cent)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

AjuneauK

I am trying to get sdfat or sd to work. 

I try the example data log sketches and watch in the serial monitor.  sdfat reports no errors.  I can see the rx led on the sd card shield light up.  I have double checked the wiring. 
When I pop the micro sd card in a reader and try to access the file on my computer I get a "problem opening the file...the file you opened has some invalid characters."  Sometimes the first couple of lines will open correctly, but garbage for the rest. 
I checked the card, it is formatted Fat16.

Is the card bad?  Is there a command (not used in the Analogger example) to close the file so you can open it on the computer?  Any suggestions on trouble shooting? 

PaulS

Quote
When I pop the micro sd card in a reader and try to access the file on my computer I get a "problem opening the file...the file you opened has some invalid characters."  Sometimes the first couple of lines will open correctly, but garbage for the rest.
I checked the card, it is formatted Fat16.

Your PC can't access the files on the SD card. Some application running on the PC can. It wasn't the PC that said "Problem opening file...". It was an application on the PC.

So, what application is doing the complaining?

What sketch is writing to the SD card on the Arduino?

olikraus

Hi

(my first post to this part of the Arduino forum)

Yesterday i tried to add SD.h to my project and gave up after 2h.
I converted everything to SdFat and got all running within 30 min.

Additionally: SD.h uses 2K more flashrom.

And to the Author of SdFat: Excellent library and outstanding documentation.

Oliver


divinny

Wow, I wonder all the time what the difference is thanks for all the answer. Cheers

Go Up