Newbie help with microSD Shield

Have questions about a SparkFun product or board? This is the place to be.

Moderator: phalanx

Post Reply
dbb
Posts: 18
Joined: Thu Dec 09, 2010 6:15 pm

Newbie help with microSD Shield

Post by dbb » Sat Feb 12, 2011 6:46 pm

I'm trying to learn as I go, but I cannot get the microSD shield and my Uno to do anything.

At first I got a bad microSD card from Sparkfun that would not be recognized by my PC. Now I have a new 2G card that I can see it working on my PC but not in the shield. I assume a lot of the comments on the product page and the forum from January 2010 have been addressed in this new one I just purchased. Simply put, after downloading the sdFat library through Sparkfun, and loading in the test example (http://www.sparkfun.com/tutorial/microS ... xample.pde), and then running it, I get nothing on the serial monitor. Inserting the card into my PC shows no files added. If I add a Serial.println(" Test ") to the code under the Serial.print(in_char); statement, I get the text "Test" every second, but nothing else.

Any ideas??

Should I be able to run that example without doing any formatting of the card first? It was formatted in FAT, I reformatted in FAT32 with no change. It may be a simple problem that I don't have the experience to see, but it looks to me like the board is bad. I see a lot of other issues with this shield in the forum so maybe they are correctable problems??

I'd appreciate some better expertise.

Thanks for your time!

Doug

fll-freak
Support Volunteer
Posts: 1518
Joined: Tue May 12, 2009 8:23 am
Location: New Hampshire, USA
Contact:

Re: Newbie help with microSD Shield

Post by fll-freak » Sat Feb 12, 2011 7:16 pm

I found the FAT library had one significant bug. It had failed to define a pin for a needed IO direction. I added
"pinMode(10, OUTPUT);"
early in the setup method and was then able to get the sample code to work. Hope it works for you.

dbb
Posts: 18
Joined: Thu Dec 09, 2010 6:15 pm

Re: Newbie help with microSD Shield

Post by dbb » Sat Feb 12, 2011 8:07 pm

Yes, I have that statement in the test example code in the 'void setup(void)' function. I assume that's where you mean rather than in the sdFAT library itself.

What is your card formatted in?

follower
Posts: 280
Joined: Sun Mar 14, 2010 11:58 pm

Re: Newbie help with microSD Shield

Post by follower » Sat Feb 12, 2011 11:42 pm

Are you using Arduino version 0022 which includes the new "SD" library? <http://arduino.cc/en/Reference/SD>

--Philip;

motopic
Posts: 272
Joined: Thu Jun 15, 2006 11:33 am

Re: Newbie help with microSD Shield

Post by motopic » Mon Feb 14, 2011 6:17 am

Exactly what sd shield do you have?
Does it have spi data level convertors for uno 5v to sd 3.3v???
If yes, then check the return codes for each step of the sd spi init.
I suggest getting sdfat from arduino sections, and not SF.

dbb
Posts: 18
Joined: Thu Dec 09, 2010 6:15 pm

Re: Newbie help with microSD Shield

Post by dbb » Mon Feb 14, 2011 8:54 am

Well, I finally got it running. I'm not sure exactly what was wrong, but could have been shorts on the soldered pins of the headers. However, I can only run it under certain circumstances.

I have the Sparkfun shield (DEV-098 2). It only runs with the sdFat library from Sparkfun. The Arduino 0022 SD library doesn't work even with the pinMode(10, OUTPUT); statement. The sdFatInfo example does work when the statement is included.

I guess if I don't change anything, all will be well, but I don't know what I'm missing by not using the new SD library.

Thanks for all your help!

follower
Posts: 280
Joined: Sun Mar 14, 2010 11:58 pm

Re: Newbie help with microSD Shield

Post by follower » Mon Feb 14, 2011 6:00 pm

dbb wrote:I have the Sparkfun shield (DEV-098 2). It only runs with the sdFat library from Sparkfun. The Arduino 0022 SD library doesn't work even with the pinMode(10, OUTPUT); statement.
It should work if you change the SD code examples to use:

Code: Select all

SD.begin(8)
Ignore the product description that talks about the pinMode etc stuff when using the SD library--the description was written before the SD library was included with the IDE.

--Philip;

dbb
Posts: 18
Joined: Thu Dec 09, 2010 6:15 pm

Re: Newbie help with microSD Shield

Post by dbb » Mon Feb 14, 2011 9:25 pm

Philip:

Thanks - I'll try that!!!

Doug

Post Reply