Micro SD Sheild and Arduino Mega

Hello everyone, this is my first post here so please let me know if this is the correct place for this question. I purchased a Micro SD Shield from sparkfun https://www.sparkfun.com/products/12761 and I am able to get it to fully work on my Arduino Uno but I am unable to get it to work on my Arduino Mega. I understand that there are two ways to get it to work. One is by changing the SD library files and the other is to purchase a TransmogriShield https://www.sparkfun.com/products/retired/11469. The TransmogriShild is not available anymore and I do not know what is a replacement for it but I would like to try the software side first. I have tried editing the SD2Card.h file to update the MEGA_SOFT_SPI value to be 1 which only gave me multiple compiling errors. I have tried a few other things but I am wondering if someone could post their adjusted SD library for the SD shield to work on the MEGA or all of the steps to make it work.

This is for a school project of mine and I am really hoping that I will be able to write to this SD card with the MEGA because I still need the other available pins. Let me know!

Hi JulianS,

This [Reference Page from Arduino has some good notes on modifying the library to work with the Mega from a software side. As for hardware, you can solder something like [this 2x3 Female Header to the 2x3 ICSP pins on your SD Shield to use the hardware SPI pins on the Mega. You may need to make some other modifications to the code for CS/SS as well as to specify you are using the ICSP header but that should work.](Header - 2x3 (Female, 0.1") - PRT-13010 - SparkFun Electronics)](SD - Arduino Reference)

Hi. Can you pse summarise what pins are required for the SparkFun microSD Shield in order that I can ensure they are not used by the code I am developing for my Arduino Mega? Thanks.

If you look at the [schematic, that will tell you what pins the shield uses. In this case, the shield uses:

5V (Power)

3.3V (Power)

GND (Ground)

D8 (CS)

D11 (MOSI)

D12 (MISO)

D13 (SCK)

Technically RESET is also used on the shield, but you don’t really need it so feel free to leave it disconnected.

D8 will work on a Mega for CS, but the Mega moves the SPI pins to another location so you’d need to jumper the pins on the shield over to the correct pins on the Mega. The pins below are what the Mega uses for SPI:

D51 (MOSI)

D50 (MISO)

D52 (SCK)](https://cdn.sparkfun.com/datasheets/Dev/Arduino/Shields/microSD_Shield_v14.pdf)