SEEED SD Card Shield and the ardunio mega 2560

Hey,

I purchased the SD shield for my Mega 2560, and I think I got it working. The issue is pretty straightforward, the SD card shield uses the SPI interface. That interface on most Arduinos in used on pin 10-13. On the Mega 2560 It’s on pin 50-53.

MEGA 2560
SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS).

UNO
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).

Now I’m assuming you can wire these pins and the power separately and get it work. However, that would be too ugly for me. I read the documentation for the SD card library and apparently this is a known issue. They have a work around that can easily be enabled, They call it “Soft SPI”. I don’t know if you will experience a performance issue but you should at-least get the functionality.

The changes that you need to make are these lines in the SdFatConfig.H file.

#define MEGA_SOFT_SPI 0
#define USE_SOFTWARE_SPI 0

to

#define MEGA_SOFT_SPI 1
#define USE_SOFTWARE_SPI 1

Save, and restart the Arduino Envoirment if it was open.

I don’t know if this will solve all your issues or if it will create new ones for you down the road. I take no responsibility if there is any sort of damage due to these modifications. I would like later tonight to bridge the arduino with wires to the shield and see if I can use the native libs. I wanted to include the links to the arduino site directly, Apparently I get a message that says “Your post looks too spamy for a new user, please remove off-site URLs.” So please verify them before you use the information.

Happy Modding!