I'm trying to do some troubleshooting with an ethernet device from Wiznet - the 820io. It is an Ethernet/SPI bridge. It is based on the W5200 chip, rather than the W5100, which meant I had to do this library change: GitHub - Wiznet/W5200_Arduino_Ethernet_Lib: Arduino Ethernet Library using W5200 from Wiznet
I have run the DHCP Address sketch, as well as this example for setting up a static IP:
#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, 1, 11);
// the router's gateway address:
IPAddress gateway(192, 168, 1, 36);
// the subnet:
IPAddress subnet(255, 255, 255, 0);
//the IP address is dependent on your network
IPAddress ip(192, 168, 1, 64);
void setup() {
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(0);
Serial.begin(9600);
while(!Serial){
;
}
// 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() {
}
I have tested both of sets of Code on the Arduino Uno, and it works fine, giving me either the static IP or an assigned DHCP IP.
However, when I run this on the Arduino Micro, I get very different results. When I open up the serial terminal for the DhcpAddressPrint example, it takes about 5-10 minutes before it will report that it was unable to get an IP. When I run the static IP example above, it immediately reports an IP of 0.0.0.0.
I have tried running this code on two different Arduino Micro's, and I see the same results. The Uno I'm testing with is using the same jumpers, ethernet connection, etc. The only difference I am making is switching the boards and specifying as such in the IDE.
Is there something different going on with the Arduino Micro/Leonardo chip setup that I need to account for? I have reviewed the documentation as much as I can, and I don't see any specific differences about Ethernet or SPI.