Hello, I am unable to initialize a W5100 module using an Arduino Pro Mini. I try setting the MAC and IP addresses but read invalid values thereafter.
Here is the Arduino program along with the output:
[code]void setup() {
uint8_t mac = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
uint8_t local_ip = {192, 168, 1, 100};
Ethernet.begin(mac, local_ip);
printMacAddress(); // OUTPUT: FF:FF:FF:FF:FF:FF
printIpAddress(); // OUTPUT: 255.255.255.255
}
void printMacAddress() {
uint8_t mac[6];
W5100.getMACAddress(mac);
Serial.print(mac[0], HEX); Serial.print(“:”); Serial.print(mac[1], HEX); Serial.print(“:”);
Serial.print(mac[2], HEX); Serial.print(“:”); Serial.print(mac[3], HEX); Serial.print(“:”);
Serial.print(mac[4], HEX); Serial.print(“:”); Serial.print(mac[5], HEX); Serial.println();
}
void printIpAddress() {
IPAddress ip = Ethernet.localIP();
Serial.println(ip);
}[/code]
I read in some blog posts that the Arduino may initialize before the W5100 initialization is completed so others recommend manually resetting the W5100 after Arduino initialization.
So I connected the W5100 reset pin to the Arduino digital output 4 and reset the W5100 during setup using the following code.
const int W5100_RESET_PIN = 4;
pinMode(W5100_RESET_PIN, OUTPUT);
digitalWrite(W5100_RESET_PIN, LOW); // Activate reset pin by asserting low
delay(5); // Wait for 5 msec
digitalWrite(W5100_RESET_PIN, HIGH); // Deactivate reset pin by asserting high
delay(300); // Wait for W5100 to initialize
I observed the W5100 resetting because the module LEDs flashed off and back on each time I manually reset the Arduino. However this does not fix the W5100 mac/IP initialization issue.
How should I troubleshoot this issue?
Here are pictures of the assembly.
[url]https://imgur.com/a/h4TWx[/url]
Here is an overview of the Arduino board.
[url]https://www.arduino.cc/en/Main/ArduinoBoardProMini[/url]
Here is an overview of the W5100 module.
[url]http://arduino-info.wikispaces.com/Ethernet[/url]
Here is the W5100 module schematic.
[url]http://arduino-info.wikispaces.com/file/view/W5100Module_sch.pdf/294763632/W5100Module_sch.pdf[/url]