Hello all!
I purchased and Arduino Mega 2560 and an Ethernet Shield 2 (which uses WIZ5500) from arduino.cc.
I am using the latest Arduino IDE downloaded from here. I have been trying to get the Ethernet to work using simple examples, but to no avail.
Here's what I've tried so far:
-
I stacked the shield on top the mega board. I have not connected any other ports using jumper cables. I use an Ethernet cable to connect to my router. I ensured that the Ethernet cable works and can see LINK and ACT light up. I must stress here that whatever I tried, I have never seen LINK flashing (indicating that RX or TX activity is present).
-
I use this simple example to check if SPI is working without any SD card present:
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192,168,0,2);
void setup() {
Serial.begin(9600);
// disable SD card if one in the slot
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
Serial.println("Starting w5500");
Ethernet.begin(mac,ip);
Serial.println(Ethernet.localIP());
}
void loop() {
}
This returns 0.0.0.0 and not the local IP. As you can see I've ensured that the SD module is disabled. I've also tested setting pins 10 and 53 to LOW without any success.
-
If I test an SD card using the CardInfo example from the SD library, I can read the SD card fine.
-
To ensure that ICSP is indeed mounted (and not hanging in the air) I've measured the pins 2 and 6 (+Vcc and Ground) and confirmed that a voltage of 4.8V appears.
-
Even though I read that the current Ethernet library supports W5500 while this was not the case in the past, I nevertheless tested different libraries (Ethernet2, EthernetMod-W5x00, and Ethernet_W5500) but these tend to hang at
Ethernet.begin(mac);
and never return or continue - or return 0.0.0.0 as indicated above.
- I tracked down the part of the code where the Ethernet library fails - it doesn't detect the chip. In fact in this function taken from w5100.cpp
uint8_t W5100Class::isW5500(void)
{
chip = 55;
Serial.println("w5100.cpp: detect W5500 chip");
if (!softReset()) return 0;
Serial.println("WriteMR 0x08");
writeMR(0x08);
if (readMR() != 0x08) return 0;
Serial.println("WriteMR 0x10");
writeMR(0x10);
if (readMR() != 0x10) return 0;
Serial.println("WriteMR 0x00");
writeMR(0x00);
if (readMR() != 0x00) return 0;
int ver = readVERSIONR_W5500();
Serial.print("version=");
Serial.println(ver);
if (ver != 4) return 0;
Serial.println("chip is W5500");
return 1;
}
and using the default web-client example I get
Initialize Ethernet with DHCP:
w5100.cpp: detect W5500 chip
WriteMR 0x08
no chip
Failed to configure Ethernet using DHCP
Ethernet shield was not found. Sorry, can't run without hardware.
indicating that the W5100Class::isW5500 function does not successfully writeMR(0x08).
If anyone has any ideas or hints on what I should do next, I'd be very grateful.
Thanks a lot for taking the time to read this post!