Seeed Studio SD Card Sheild 3.0 + Mega 2560 Rev 3

Hey Guys,

RadioShack sells the Seeed Studio SD Card Sheild 3.0 and the Arduino Mega 2560 rev 3 together on the same shelf, plus the former advertises itself as Arduino compatible, so, silly me, I just assumed they would work together.

When do you actually find out that they're not? Well, you take the little card that was hidden in the packaging, go to the website they tell you to:

http://www.seeedstudio.com/wiki/SD_Card_Shield

And find this phrase:

"Do not compatible with Mega"

So basically their "Arduino Compatible" label is just BS. I feel completely lied to, and it's safe to say I won't ever purchase another Seeed product.

Anyways, someone else on these forums provided these directions for how to make the Seeed work with my Mega two years ago:

bosduino: This isn't really a clean solution, but it works as long as you don't plan to stack any additional shields on top of the SEEED SD shield:

There are two different options. a) is safer, b) will involve clipping some of the pins on the SD shield.

Here's a):

1) Connect all headers on the "analog side" (Analog and Power) using a separate set of headers to create space between the boards 2) use a jumper wire to connect Mega Pin 10 to SD pin 10 3) use a jumper wire to connect Mega Pin 50 to SD pin 12 4) use a jumper wire to connect Mega Pin 51 to SD pin 11 5) use a jumper wire to connect Mega Pin 52 to SD pin 13 6) Upload the sketch and try it.

And here's b) (BEWARE! There's no way back if you mess up!):

1) Trim all digital pins off the SD shield EXCEPT pin 10 2) Stack the SD shield onto the Mega 3) use a jumper wire to connect Mega Pin 50 to SD pin 12 4) use a jumper wire to connect Mega Pin 51 to SD pin 11 5) use a jumper wire to connect Mega Pin 52 to SD pin 13 6) Upload the sketch and try it.

I'd like to just run the CardInfo Example code.

Here's the part that I wonder about:

Is it possible to just change some variables in the example code so that it'll work with my Mega? I feel like exposing these variables was a rather recent change that opens up the SD library to be used with a wider variety of SD card readers. Namely, I noticed that:

chipSelect can be changed. pinMode accepts a variable.

So… is there some way I can utilize those variables to make the Seeed SD Card Shield work for me, or is my best option to add jumper cables as suggested in the post I quoted?

You may want to take a look here and see if you can apply any of the changes Adafruit makes to make it work...

http://learn.adafruit.com/adafruit-data-logger-shield/using-the-real-time-clock-1

RobDrizzle:
You may want to take a look here and see if you can apply any of the changes Adafruit makes to make it work…

http://learn.adafruit.com/adafruit-data-logger-shield/using-the-real-time-clock-1

Hi Rob, thanks for that but they mention that the example code for CardInfo should have a call to SD.begin, but it doesn’t. It has a line with card.init, but it doesn’t take the same parameters. The article seems to have been written in 2013 while the example was last modified in 2012, so it doesn’t seem like it should be an example with the article and me starting with a different example…

I looked at the source code for card.init and it doesn’t even call SD.begin inside of it…

The seeed studio card info?

Adafruit uses the SDfat lib which has it's own Card info example if that would work.

Thanks Rob!

The very next page of the directions you gave contained all the important information on making this work:

I didn’t have to bend a single pin or anything! Words cannot express how happy I am right now that it’s working. XD

AoW, glad to hear that you got your sd card working, but I wanted to put a notice in here for anyone else who is considering buying one of these Seeed sd card shields. I bought one from RS, and discovered that they use the old resistor hack for level-shifting, instead of a proper IC. According to sources on this board, I believe this can cause problems with some of the newer cards. Anyone confirm or refute this?

Success of using voltage dividers depends on the sensitivity of the card to a distorted SPI signal and the amount of stray capacitance plus the input capacitance of the card.

I attached a simulation of a 1 k ohm/2k ohm divider with 20 pf capacitance at 8 MHz.

Here is a YouTube video that shows the type of distortion that occurs in voltage dividers with stray capacitance http://www.youtube.com/watch?v=gU9hKdsS9-I.

See the wave forms at about 2:20 - 3:00 minutes:seconds into the video. In principle you could compensate for stray capacitance.

An SD card has about 10 pf input capacitance and stray capacitance can be around 30pf for a total of capacitance of about 40 pf.

To get signal rise times in the sub 10 ns range, which is required to meet the SD spec, you need very small resistors.

I did studies of the original Adafruit shields with resistor voltage dividers when I wrote the first version of SdFat and convinced Limor Fried of Adafruit to replace resistor dividers with IC buffers.

Here is a YouTube circuit simulator study of this problem Getting Started with CircuitLab - YouTube.

Here is another paper that discusses SD card signal conditioning http://www.nxp.com/documents/application_note/AN10911.pdf.

ArtOfWarfare: Thanks Rob!

The very next page of the directions you gave contained all the important information on making this work:

http://learn.adafruit.com/adafruit-data-logger-shield/for-the-mega-and-leonardo

I didn't have to bend a single pin or anything! Words cannot express how happy I am right now that it's working. XD

Hi, would you mind to post your code from the beginning to end of the setup? I'm having the same troubles and I just can't understand what I'm doing wrong!

Thank you

olimex,

See http://forum.arduino.cc/index.php?topic=165170.msg1606840#msg1606840

Thank you! :D