WIZnet Developer Forum

Unable to initialize W5100 using Arduino Pro Mini

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.
https://imgur.com/a/h4TWx

Here is an overview of the Arduino board.
https://www.arduino.cc/en/Main/ArduinoBoardProMini

Here is an overview of the W5100 module.
http://arduino-info.wikispaces.com/Ethernet

Here is the W5100 module schematic.
http://arduino-info.wikispaces.com/file/view/W5100Module_sch.pdf/294763632/W5100Module_sch.pdf

Hi…

First, refer to below site and download library. (It is lastest update)

Please Download ZIP button.

github.com/Wiznet/WIZ_Ethernet_Library

So, Delete the ethernet folder that has the original. Delete the ethernet folder that has the original.

and this route to copy & paste to download file.

Second, retry test.

Thank you

I am using Arduino v1.6.7. Would the library WIZ Ethernet Arduino IDE 1.5.x work with Arduino 1.6.7 or should I use Arduino 1.5.x?

Also, how should I proceed if this does not fix the issue? I am in a far timezone from you and our conversation may be delayed as a result.

Hello,

I deleted the Arduino Ethernet library directory and replaced it with the library in your GitHub account. I am still unable to initialize the W5100.

How should I keep debugging this issue?

Thank you.

hi,
concerns little Arduino but…

my hardware init sequence is :
set CS and RST as output
low RST
high CS
high RST
set SPI config ( spi as master, oscdiv , clock idle low, clock rising edge , sample at middle )
enable SPI
delay 500 usecs

now set W5100:
write on MR reg 0x80 value ( software reset ) (see note)
set gateway
set mac
set subnet
set ip address
set memory sizes for TX and RX
delay 800 msecs

after a DHCP response ( if used ) you can reassign net parms starting from MR reg step and maybe that’s what you’re missing.
Last 800 msecs time wait is a a certainty because the W5100 you should respond in 300/400 msecs while if you overdo it you can check the RDY pin and waste another IO to do it (I honestly prefer to wait a second).
This works in many embedded sources but now you must find the functions that make it into Arduino’s dialect .

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.