Thank you SurferTim for the response.
Yes my unit has a 6 pin ICSP so that answers the first question so thank you.
I've had a look at your code which you supplied unless i've missed something obvious Im still getting an error (infact its stopping at the SD card check not the Ethernet check).
Heres the code I tried:
#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>
const int chipSelect = 4;
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1, 254 };
void setup()
{
Serial.begin(9600);
// just to be safe, I disable the w5100 SPI while starting the SD SPI
// I had problems in restarting without this in my FTP code
pinMode(53,OUTPUT); //location of the SS pin, 53 on the Mega, 10 on other
digitalWrite(53,HIGH);
}
void loop()
{
// start the SD card
// this begin returns with the SD SPI disabled
if(SD.begin(chipSelect) == 0) Serial.println("SD fail");
// start the ethernet port
// this begin returns with the w5100 SPI enabled
Ethernet.begin(mac,ip);
digitalWrite(10,HIGH);
}
The microSD card is a 4Gb SDHC card which is known to work so its not the card however it keeps bouncing back as a fail.
Ive also tried:
#include <SD.h>
File myFile;
void setup()
{
Serial.begin(9600);
Serial.print("Initializing SD card...");
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
// Note that even if it's not used as the CS pin, the hardware SS pin
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
// or the SD library functions will not work.
pinMode(53, OUTPUT);
if (!SD.begin(4)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
myFile = SD.open("test.txt", FILE_WRITE);
// if the file opened okay, write to it:
if (myFile) {
Serial.print("Writing to test.txt...");
myFile.println("testing 1, 2, 3.");
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
// re-open the file for reading:
myFile = SD.open("test.txt");
if (myFile) {
Serial.println("test.txt:");
// read from the file until there's nothing else in it:
while (myFile.available()) {
Serial.write(myFile.read());
}
// close the file:
myFile.close();
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
}
void loop()
{
// nothing happens after setup
}
That also failed.. I've tried it with my other MicroSD card which is an 8GB SDHC card.
Hmm (I know this is slighly siding away from Networking, however it uses the W5100 shield and I have plenty of questions to do with network communications as well!)
Any Ideas folks?
Best regards
Luke