W5100 Probleme ethernet

Hello all
I just received my W5100 ethernet shield + MicroSD.
Here in the picture:

My board is a mega 1280.
First thing strange:
For the card reader, normally for this kind of shield, the ChipSelect is 4 and, no way to make it work.
After some research, I saw that some shields card reader used the PIN 8.
I tested and the miracle :), it works.
So I decided to go to the function and the ethernet ... : 0: smiley-smiley :: roll-blue-zip: = (.
From what I read, the CS 10 and 53 for the uno for the mega.
So I tried with 10, with 53 post and nothing works.
My shield does not want to assign a correct IP.
Here is my code:
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {
** 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };**
IPAddress ip(192,168,1, 55);
void setup() {

** pinMode(53, OUTPUT);**
** digitalWrite(53,HIGH);**
** delay(1000);**
** Serial.begin(9600);**
** Ethernet.begin(mac, ip);**

** // print your local IP address:**
** Serial.print("My IP address: ");**
** ip = Ethernet.localIP();**
** for (byte thisByte = 0; thisByte < 4; thisByte++) {**
** // print the value of each byte of the IP address:**
** Serial.print(ip[thisByte], DEC);**
** Serial.print(".");**
** }**
** Serial.println();**
}
void loop() {
}

I tried to mount the drive has PIN8 LOW in case but nothing changes.
Always the same thing: My IP address: 255.255.255.255.
I said that on my shield he had not the MAC @ Stickers but apparently a new shield on there is no predefined MAC @.
I need light, if someone can help me.
thank you

FRENCH :
Bonjour a tous
Je viens juste de recevoir mon shield W5100 ethernet+MicroSD .
Cela fais maintenant 2 jours que je galere. Le voici en photo :

Ma board est une mega 1280.
Premiere chose louche :
Pour le lecteur de carte, normalement, pour ce genre de shield, le ChipSelect est 4 et la , pas moyen de le faire marcher.
Apres quelques recherche, j'ai vue que certains shields lecteur de carte utilisés la PIN 8.
J'ai testé et la miracle :), ça marche.
J'ai donc decidé de passer a la fonction ethernet et la ... :0 :roll_eyes: :zipper_mouth_face: =( .
D’après ce que j'ai pu lire, le CS est 10 pour le uno et 53 pour le mega.
J'ai donc tenté avec 10, après avec 53 et rien ne fonctionne.
Mon shield ne veut pas s'affecter une IP correct.
Voici mon code :
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {
** 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };**
IPAddress ip(192,168,1, 55);
void setup() {

** pinMode(53, OUTPUT);**
** digitalWrite(53,HIGH);**
** delay(1000);**
** Serial.begin(9600);**
** Ethernet.begin(mac, ip);**

** // print your local IP address:**
** Serial.print("My IP address: ");**
** ip = Ethernet.localIP();**
** for (byte thisByte = 0; thisByte < 4; thisByte++) {**
** // print the value of each byte of the IP address:**
** Serial.print(ip[thisByte], DEC);**
** Serial.print(".");**
** }**
** Serial.println();**
}
void loop() {
}

J'ai essayé aussi de mettre la PIN8 du lecteur a LOW au cas où mais rien ne change.
Toujours la meme chose : My IP address: 255.255.255.255.
Je précise que sur mon shield il n'y avais pas l'@ MAC sur un Stickers mais apparemment sur les nouveau shield il n'y a pas d'@ MAC prédéfinie.
J'ai besoin de lumière, si quelqu'un peux m'aider .
Merci

Try the Ethernet library example "DhcpAddressPrinter" and report your results.

Hello
Thanks for your interest .
The result is :
Failed to configure Ethernet using DHCP
I've got a DHCP server and no request for an address.

whiskygt:
I said that on my shield he had not the MAC @ Stickers but apparently a new shield on there is no predefined MAC @.

I just bought a brand new, genuine Arduino Ethernet Shield R3, and it most definitely has a sticker with the MAC address on it.

So here is the problem, the MAC @ .
How could i find the MAC @ without this F..K..G Stickers ?

The Media Access Controller (MAC) address is supposed to be assigned by the equipment manufacturer. They get assigned a big block of numbers and pass them out to each device as it is made.

Any number should work fine as long as no other Ethernet device on the LAN uses the same number.

So it's not my problem...
Any other idea ?

whiskygt:
Failed to configure Ethernet using DHCP

Sounds like something is wrong in the Ethernet hardware: the shield, the cable, the router... Could be almost anything.

I think it's hardware because everythings works correcly , the router the cable.
I will try to get another one , another genuine one ...
Thanks

Although you are using pin 10 for SS you still have to set pin 53 as an output for SPI to work.

Have you done this?

See: http://arduino.cc/en/Main/ArduinoEthernetShield

Yes the PIN53 is set as an output.
Do i need to set PIN 10 as an output and HIGH ???
If you're not using one of the peripherals in your program, however, you'll need to explicitly deselect it. To do this with the SD card, set pin 4 as an output and write a high to it. For the W5100, set digital pin 10 as a high output.
As i understand, i just need to put 53 as an output and put 4 as an output and HIGH that's all ???

First thing strange:
For the card reader, normally for this kind of shield, the ChipSelect is 4 and, no way to make it work.
After some research, I saw that some shields card reader used the PIN 8.
I tested and the miracle , it works.

That is a miracle. Are you still using that pin as the SD SS pin?

Digital pin 4 is the SD Slave Select for almost all ethernet/SD shields. Digital pin 8 is not connected to anything on most shields.

Maybe it is the model of that shield?

Yes i use pin 8 as the cs for sd reader . It s the only way to make it works ...

If that is the case, I suspect the shield is not compatible with the standard pinouts of an ethernet shield on both the w5100 (that is the ethernet IC, correct?) and the SD reader.

I recommend getting a newer model ethernet shield, insuring it is one with the w5100.

Just a thought...

Are you certain the SD CS pin is digital pin 8?

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

   // disable w5100 SPI
   pinMode(10, OUTPUT);
   digitalWrite(10,HIGH);

   if(SD.begin(4) == 0)
   {
      Serial.println("Unable to start SD");
   }
   else
   {
      Serial.println("SD ok");
   }

   // rest of setup code
}

Hey, I use the exact shield with a Mega2560 and an Uno here are some things i do. I hope I've layed this out in an easy understandable way for you (this is my first post).

Define MAC Address:

byte mac[] = { 0xAA, 0x07, 0x03, 0x07, 0xF8, 0xBD };

Define pins:

int sdSSCardPin = 4;

#ifdef __AVR_ATmega2560__
int ethernetSSPin = 53;
#else
int ethernetSSPin = 10;
#endif

Setup block:

void setup()
{
	//ensures pinModes are set and devices are disabled.
	setSSPins();
	
	//initialize the card reader then start ethernet sheild and obtain IP address
	initializeSDCard();
	initializeEthernet();

	EthernetServer server = EthernetServer(8080);
	server.begin();
}

void setSSPins()
{
	//Sets SS pin for SD Card Reader
	pinMode(sdSSCardPin, OUTPUT);
	digitalWrite(sdSSCardPin, HIGH);

	//Sets SS pin for Ethernet
	pinMode(ethernetSSPin, OUTPUT);
	digitalWrite(ethernetSSPin, HIGH);
}

void initializeSDCard()
{
	if (!SD.begin(sdSSCardPin)) 
	{
	    Serial.println("initializeSDCard() -- SD Card Reader initialization failed");
	}
}

void initializeEthernet()
{
	int returnVal = Ethernet.begin(mac);
	if (returnVal == 0 )
	{
		Serial.println("initializeEthernet() -- DHCP initialization failed");
	}
	else if (returnVal == 1)
	{
		IPAddress ip = Ethernet.localIP();

		Serial.print("initializeEthernet() -- IPAddress: ");
		Serial.println(ip);
	}
}