arduino ethernet shield sd card on the mega

okay, so i'm using the arduino mega, and i want to use the sd slot in the ethernet shield. i have tried running the listfiles SD example code, but i get "Initializing SD card...initialization failed!". i have zero experiance with SD on the arduino, and using the SPI interface. the theory i have comes from the following, found in the comments of the code

  • SD card attached to SPI bus as follows:
    ** MOSI - pin 11
    ** MISO - pin 12
    ** CLK - pin 13
    ** CS - pin 4

and i understand that the SPI pins are mapped differently on the mega. (and why is that?)

mc kenny
Do you have a mega with seperate spi pins? Has your ethernet card seperate SPI pins?
If not you will need a hack. See this article http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack/
This post explains why the pins are assigned differently on the 2 boards.
Please explain:SPI uses pin 11->13 on the uno and pins 50->52 on the Mega - Networking, Protocols, and Devices - Arduino Forum
Now I understand it I'm happy about how they did it :slight_smile:
Best regards
Jantje

This post shows how to access the microSD card.
http://arduino.cc/forum/index.php/topic,86837.0.html