Micro SD card library

BDub & billprozac, after reviewing the examples I noticed that they are somewhat helter-skelter in how they use the library. A call to card.init() correctly configures the library for hardware or software SPI and sets the pinMode for all pins. A call to SD.begin() combines the card, volume and root initialization calls into one but with a single true/false return as an error. So you call begin() if you just want a go/no-go or each separate functions if you want more details. The examples make use of both approaches. One thing missing from the examples is code to demonstrate a software SPI configuration.

In reviewing the code I also found that the specified chipselect pin for the hardware SPI mode is NOT configured for OUTPUT whereas it is for the software SPI mode. As soon as I get a chance, I will make the changes to the init() code and the examples. BDub, I will do a pull request once Iā€™m done. :smile:

2 Likes

BDub, I just posted a pull request for the changes on the microSD library. Full testing still needs to be done. :smile:

1 Like

Can someone try this library with new Spark firmware 0.2.2 regarding with https://community.spark.io/t/spark-v0-2-2-out-of-memory/4414/17 topic.

I will give it a shot in the morning.

Any luck regarding this memory issue :blush: ?

After a bit of cursing i got this to work from the web IDE!!

I had to change the #include <Application> bits to #include "application" to get it to compile

And the cursing came from the link to the -ve railā€¦ i went to the rail that wasnā€™t connectedā€¦ oops

1 Like

Hello all. I just wanted to thank @BDub and all others for their excellent work on this nice addition to the Spark Core ecosystemā€¦

Using the pictures I easily converted a Micro SD adapter with some heading pins into a working MicroSD reader for the core. I used 90 degrees bend header pins to allow a flat card on my breadboard and printed pin-out labels to avoid problems. Luckily my core didnā€™t die after a stupid shortcut by a misplaced jumper wire, despite those labelsā€¦

Using the online IDE I successfully ran all the examples with a 4GB card. The card was successfully identified as a SDHC card and the speed test showed reading speeds around 288 kB/s and writing around 145 kB/s. The read/write example showed me how to include file reading into my webserver project, which gives me much better flexibility.

Next TODO on my list is to enable long filenames. I presume a PHP/MySQL library with .htaccess url rewriting is a bit too much to ask for the coreā€¦ :wink:

So; thanks again for your great work!

2 Likes