Go Down

Topic: microSD fails to initialize with Arduino Due and Sparkfun microSD shield (Read 880 times) previous topic - next topic

shareefm

Hi,

I'm trying to interface my Sparkfun microSD with my Arduino Due. I had quite a few problems with it so I tried to use this simple program with it but it fails -> http://arduino.cc/en/Tutorial/CardInfo . The following message appears in the serial monitor: "initialization failed. Things to check:..."

The code doesn't work off the bat and I had to add the SPI header line. -> #include <SPI.h>

I tried it with an Arduino UNO too but that fails as well. My microSD card is a 2GB card formated into FAT32. I also changed the CS to 8 as I am using a Sparkfun microSD shield.

The quickstart guide from Sparkfun instructed me to solder the headers onto the shield, but I am currently using the shield without the headers soldered on, to test it. How likely is it that this is the issue?

Any help is appreciated.

Thanks

fat16lib

Quote

The quickstart guide from Sparkfun instructed me to solder the headers onto the shield, but I am currently using the shield without the headers soldered on, to test it. How likely is it that this is the issue?

It's very unlikely to work unless the headers are soldered.

Quote
My microSD card is a 2GB card formated into FAT32.

This is a bad choice.  FAT32 should only be used on 4 GB and larger cards.  SD cards are designed for standard formats specified by the SD association.  Using other formats can degrade performance.

Don't use Windows, OS X, or Linux utilities to format SD cards.  This is the best formatter https://www.sdcard.org/downloads/formatter_4/.

shareefm

Thank you very much for the advice. I reformatted the card to FAT (aka FAT16), and soldered the headers onto the shield. But I'm still getting an error for initialization.

I've attached my photos of the soldering job. Did I mess it up?

fat16lib

This shield will not work with Due.  It does not connect to the SPI header on Due.
Quote

Due SPI: SPI header (ICSP header on other Arduino boards)
These pins support SPI communication using the SPI library. The SPI pins are broken out on the central 6-pin header, which is physically compatible with the Uno, Leonardo and Mega2560.


Try it on Uno with chip select set to pin 8.

Quote

I reformatted the card to FAT (aka FAT16),


You should use the SD association's formatter.  It selects the correct cluster size and adds hidden blocks to align flash memory boundaries properly for best performance.

Modern SD cards have very large complex flash chips and OS utilities do not understand how to format  SD cards for optimum performance.

Go Up