Go Down

Topic: continuity in SD cover and ICSP pin? (Read 692 times) previous topic - next topic

nokasho

Dec 04, 2012, 03:24 pm Last Edit: Dec 04, 2012, 03:37 pm by nokasho Reason: 1
Hello friends!

I'm working in a proyect with LCD + Ethernet w/SD, but i had a little problem :(

Everything is worrking, but i cant save/read date in my SD card. I know, my shield is from China and nobody likes it
anyway, i realized that one of the ICSP pin is connect with the SD cover...

is it connect or is it a manufactured failure?!

Please help, i need to know this to my thesis!

Thanks for you help!!!
Me

\{end}

SurferTim

Quote
I'm working in a proyect with LCD + Ethernet w/SD, but i had a little problem

It is helpful if you post links to the exact equipment you are using, then describe how they are connected to the Arduino.

nokasho

Me

\{end}

SurferTim

#3
Dec 04, 2012, 03:43 pm Last Edit: Dec 04, 2012, 03:47 pm by SurferTim Reason: 1
OK, simple test sketch that show how to initialize both the w5100 and sd so they work together.
Code: [Select]
#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>

byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

void setup() {
 Serial.begin(9600);

 // disable w5100 while starting SD
 pinMode(10,OUTPUT);
 digitalWrite(10,HIGH);

 Serial.print("Starting SD...");
 if(!SD.begin(4)) Serial.println("Failed");
 else Serial.println("ok");

 Serial.println("Starting w5100...")
 if(!Ethernet.begin(mac)) Serial.println("failed");
 else Serial.println("ok");
 // correct Ethernet.begin() SPI SS bug
 digitalWrite(10,HIGH);

 Serial.println("Setup complete");
}

void loop() {
}

Do both start ok?

I recommend compiling and uploading the sketch, then power down the Arduino for a few seconds to get rid of any bad settings from previous tries, and power it up and open the serial monitor. I usually do this after trying someone else's sketch that doesn't follow this procedure to get mine working again.

edit: If the ethernet shield is working ok, then the pin touching the SD slot should not affect the SD. They both use the SPI pins on that connector. One of those ICSP pins is ground, and so is the SD case.

nokasho

Code: [Select]

Starting SD...Failed
Starting w5100...
ok
Setup complete


I've tried SD and SDHC, FAT and FAT32, and nothing's working :(
Me

\{end}

SurferTim

If the w5100 is returning "ok", then the SPI bus is working. That would eliminate the SD fail due to the touching pin. If that pin touching failed the SPI bus, the w5100 would have also failed.

In this case, you may want to post a question in the storage section of the forum. fat16lib is the guy to get you going with the SD stuff.

Go Up