Arduino Ethernet Shield W5100 can not be assigned IP address

Hello Guys,

I have a problem assigning IP Address to my Arduino Ethernet Shield W5100. The IP Address keep showing 255.255.255.255. I actually have tried to disable the SD Card using the code that I found from most forum, I still can not assign IP Address. Would there be a problem with my Arduino Shield W5100, how would I know if there is? Please help.

I use the standard code from this website below with additional disable SD function:

#include <SPI.h>
#include <Ethernet.h>

// network configuration. dns server, gateway and subnet are optional.

// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

// the dns server ip
IPAddress dnServer(192, 168, 100, 1);
// the router's gateway address:
IPAddress gateway(192, 168, 100, 1);
// the subnet:
IPAddress subnet(255, 255, 255, 0);

//the IP address is dependent on your network
IPAddress ip(192, 168, 100, 16);

void setup() {

// Disable SD
pinMode(4, OUTPUT);
digitalWrite(4, HIGH);

Serial.begin(9600);

// initialize the ethernet device
Ethernet.begin(mac, ip, dnServer, gateway, subnet);
//print out the IP address
Serial.print("IP = ");
Serial.println(Ethernet.localIP());
}

void loop() {
}

Hi Guys,

I found the solution from this site already.

https://forum.arduino.cc/index.php?topic=223411.0

So the code I need to add is below:
// SS must be output and disable any device using SS
pinMode(53,OUTPUT);
digitalWrite(53,HIGH); //any device on the SS pin will be disabled

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

// disable SD
pinMode(4,OUTPUT);
digitalWrite(4,HIGH); // disable SD

//Add code in function setup(), i'm success.
pinMode(11,INPUT);
pinMode(12,INPUT);
pinMode(13,INPUT);

Thanks for the forum