Re: FAT32/SDHC library for Wave and other shields

by ericzundel on Tue Aug 25, 2009 9:53 am

I did some work to minimize file i/o and added a few noInterrupts(); ... interrupts() guards and the project is working much better.
User avatar
ericzundel
 
Posts: 38
Joined: Thu Aug 06, 2009 9:42 pm

Re: FAT32/SDHC library for Wave and other shields

by doshir on Thu Oct 22, 2009 11:08 pm

I succeeded to access subdirectories and w/r files in the subdirectory with minor modification for SdFay.cpp in WaveRP library.

$ diff libraries/SdFat/SdFat.cpp sdfat_save/SdFat.cpp
279d278
< fileSize_ = 32 * 65534; // Fat16 and Fat32 sub dir entry max : 65534
288a288
> fileSize_ = dir.fileSize;

With this modification, depends on size of the SD/SDHC card, with FAT16 formatted 2GB card, a subdirectory can hold 1022 files.
It is not fully tested yet. Just wrote 1000 unique short files then verified in a subdirectory.
For increase the number of the files, it need to touch uint8_t SdFile::create(SdFile &dirFile, char *fileName) but 1022 files is enough for me now.
User avatar
doshir
 
Posts: 1
Joined: Thu Oct 22, 2009 10:36 pm

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Tue Oct 27, 2009 10:17 am

doshir,

your mod will result in a corrupt file system.
fat16lib
 
Posts: 591
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by adumas on Thu Jun 17, 2010 11:20 am

Hi.... I'm currently doing a project using the datalogger and the SDFat library with bitlash... I'm thinking there is an incompatability of the the bitlash library...

So, I was wondering if I could use your SD library instead of the SDFat library?

My need is to read a file on an SD drive and extract the contents from the file...

Is there a quick example for doing the initialization of the sd card and the reading of a file?

I'm using the SdFatRead example and it works fine...
adumas
 
Posts: 29
Joined: Mon Mar 16, 2009 5:59 pm

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Thu Jun 17, 2010 12:41 pm

SdFat was derived from WaveHC so it is not likely to work better with Bitlash. SdFat works in the standard Arduino environment.

You should contact the the author of Bitlash if you have problems using Bitlash with Arduino libraries.
fat16lib
 
Posts: 591
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by rawore on Tue Aug 03, 2010 3:59 pm

re: replacement of resistor divider with 74LCX245

I'm seeing surface mount parts (at digikey, for instance) but not a lot of dip parts.

can you suggest a supplier for several chip quantities?

or an equivalent part.

just got a 1.1 kit, and then found this thread.

thanks for any help.

regards
bob
rawore
 
Posts: 1
Joined: Sun Jul 18, 2010 8:26 pm

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Wed Aug 04, 2010 9:35 am

I have used 74HC4050N and 74AHC125N DIP parts for level shifters. Adafruit uses 74AHC125N for some shields. I use http://www.findchips.com/ to find stock.
fat16lib
 
Posts: 591
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by AndrewNC on Sat May 07, 2011 3:51 pm

I discovered an issue with the latest shipping SD cards from adafruit, and found a solution:
http://code.google.com/p/wavehc/issues/detail?id=1

Those "works the first time, then fails" type of issues are always the most fun to track down, but I learned a lot along the way. I wonder if cards that otherwise didn't work at all before will now play nice?
AndrewNC
 
Posts: 1
Joined: Sat May 07, 2011 3:43 pm

Re: FAT32/SDHC library for Wave and other shields

by miax on Tue Jul 19, 2011 5:41 pm

fat16lib,

First let me say THANK YOU for all the time you and code you donate to the community! Your WaveHC library and FatReader/Fat16 libs are Very nice.

I have run into the situation that another user had in which I have a Wave shield and a PN532 break-out board configured on a Mega 2560 with an LCD. It all works Great until I got to the point of actually logging the responses on the RFID reader so that a server can scoup the data via the web at intervals. This time I read and researched before posting, and have noted in this thread that your working on a version of your library that will include write capability...

First question I have is; is that out? Or is it still far-ish in the future?

Secondly - assuming that its not done/soon, what would you recommend I use in the interim as the Smallest SD/Fat library that I can read/write with?

Thanks!!

Kris
User avatar
miax
 
Posts: 134
Joined: Tue Apr 05, 2011 10:41 am

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Tue Jul 19, 2011 6:06 pm

There is a second library, WaveRP, that uses SdFat and can play and record wav files.

It is here http://code.google.com/p/waverp/

There has not been much interest in this library.

Since it uses SdFat, you can write files.
fat16lib
 
Posts: 591
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by miax on Wed Jul 20, 2011 6:00 am

Awesome! Thanks for the link. :D

I'm downloading it now and will work toward integrating it tonight. I'll report back with how it goes.

---Update:

This is a very neat library. :) Just reading through the WaveRP.cpp file has taught me a little more about coding on the Arduino and for that alone I am grateful!

However, the library is rather large (~23k at compile time), and I'm just not good-enough at coding to hack out stuff that I won't use and not break things (hehe).

Unfortunately its too big for my project - I'm drivinging a PN532 NFC board, a ST7656 LCD, the Wave shield, Ethernet shield, a Rotary encoder and a Chrono-dot - which means my memory is already very limited. Using WaveHC, my compile size is 31.4k and that leaves me with about 600 bytes of free ram on the Mega during run-time. So the size of WaveHC is Perfect, but writing to an SD card may be impossible with this rig.

Thanks for the suggestion, it was fun working with it!

Cheers,

Kris
User avatar
miax
 
Posts: 134
Joined: Tue Apr 05, 2011 10:41 am