Pages: [1]   Go Down
Author Topic: sdfat vs. sd  (Read 2072 times)
0 Members and 1 Guest are viewing this topic.
East Coast
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Edison Member
*
Karma: 44
Posts: 1471
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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! 
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

my experience, sdfat works, sd doesn't

3 cents (thats a bonus cent)
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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? 
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 45982
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Germany
Offline Offline
Edison Member
*
Karma: 100
Posts: 1219
If you believe something is right, you won't see what's wrong (David Straker).
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Indonesia
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Hey all! :)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: