terryz:
I had issues with the W5100 locking up after a few days of operation, the Ethernet port froze however the rest of my code kept working. Research on the topic strongly suggested that the chip be periodically reset and to do that you had to separate it's reset from the Arduino reset. I modified the circuit per the attached and used the following code and have not had any issues since. If you choose to separate the Wiznet 5100 reset from the Arduino /MASTER_RESET line you must also control the Wiznet 5100 SEN pin. In the attached schematic, you can see that the RESET signal going into the Diodes, Inc. APX811 Microcontroller supervisor chip and the SEN input to the W5100 are now controlled directly by Micro outputs D48 and D50. Use the Supervisor chip to hold the W5100 in RESET until the 3.3VDC power supply rails are stabilized on power up (that fixes issues with power up reset power disturbances). The APX811 chip, upon turning off D50 (input to /MR) will turn off the /RESET input to the W5100 for 240mS. Therefore we MUST delay any execution of code for the W5100 after reset is applied for at least 240ms.
THE SEN line is controlled with the SPI select pin. In this example, ENET is D4, SDCard is D10, WizSEN is D48 and WizRESET is D50.
void SPIselect(int device) {
if (device == SDcard) {
digitalWrite(SDcard, OFF);
digitalWrite(ENET, ON);
digitalWrite(WizSEN, OFF);
}
else {
digitalWrite(SDcard, ON);
digitalWrite(ENET, OFF);
digitalWrite(WizSEN, ON);
}
delay(2);
resetWDT();
}
A function that I call to reset the Wiznet W5100 goes like this.
void EthernetClient resetWiznet() {
SPIselect(ENET);
delay(50);
digitalWrite(WizResetSignal, OFF); //low resets the W5100 chip
delay(25); //Keep this short, 25ms is good
digitalWrite(WizResetSignal, ON);
delay(500); //The hardware reset to Wiznet is Diodes, Inc APX811 chip that will hold reset into the
//Wiznet low for 240ms, so we must wait until it is re-asserts.
Ethernet.begin(mac, ip); //mac and ip are your settings fro your Arduino
delay(250);
server.begin();
delay(50);
Serial.print(F("The IP Address is: "));
IPAddress address = Ethernet.localIP();
Serial.println(address);
return (server.available()); //returns the client id of the newly reset Ethernet port
}
terryz:
I had issues with the W5100 locking up after a few days of operation, the Ethernet port froze however the rest of my code kept working. Research on the topic strongly suggested that the chip be periodically reset and to do that you had to separate it's reset from the Arduino reset. I modified the circuit per the attached and used the following code and have not had any issues since. If you choose to separate the Wiznet 5100 reset from the Arduino /MASTER_RESET line you must also control the Wiznet 5100 SEN pin. In the attached schematic, you can see that the RESET signal going into the Diodes, Inc. APX811 Microcontroller supervisor chip and the SEN input to the W5100 are now controlled directly by Micro outputs D48 and D50. Use the Supervisor chip to hold the W5100 in RESET until the 3.3VDC power supply rails are stabilized on power up (that fixes issues with power up reset power disturbances). The APX811 chip, upon turning off D50 (input to /MR) will turn off the /RESET input to the W5100 for 240mS. Therefore we MUST delay any execution of code for the W5100 after reset is applied for at least 240ms.
THE SEN line is controlled with the SPI select pin. In this example, ENET is D4, SDCard is D10, WizSEN is D48 and WizRESET is D50.
void SPIselect(int device) {
if (device == SDcard) {
digitalWrite(SDcard, OFF);
digitalWrite(ENET, ON);
digitalWrite(WizSEN, OFF);
}
else {
digitalWrite(SDcard, ON);
digitalWrite(ENET, OFF);
digitalWrite(WizSEN, ON);
}
delay(2);
resetWDT();
}
A function that I call to reset the Wiznet W5100 goes like this.
void EthernetClient resetWiznet() {
SPIselect(ENET);
delay(50);
digitalWrite(WizResetSignal, OFF); //low resets the W5100 chip
delay(25); //Keep this short, 25ms is good
digitalWrite(WizResetSignal, ON);
delay(500); //The hardware reset to Wiznet is Diodes, Inc APX811 chip that will hold reset into the
//Wiznet low for 240ms, so we must wait until it is re-asserts.
Ethernet.begin(mac, ip); //mac and ip are your settings fro your Arduino
delay(250);
server.begin();
delay(50);
Serial.print(F("The IP Address is: "));
IPAddress address = Ethernet.localIP();
Serial.println(address);
return (server.available()); //returns the client id of the newly reset Ethernet port
}