W5200 Arduino Ethernet Shield

Hi

I have an Arduino Uno R3 and I just recently got a w5200 ethernet shield.

https://www.robotshop.com/en/ethernet-w5200-shield-arduino.htm

To test the shield, I used the example web server found in the Arduino IDE. The only changes I made to the code, was in changing the IP address to match my LAN network, and uncommenting the line to use pin 10 as the CS pin. Once uploaded the serial monitor from the Arduino IDE reports an error where the shield has not been detected. I have tried changing the CS pin to 9, 6, 5, and 3, (the pins with an asterisk next to pin number on the shield) but none of them worked. Arduino IDE is on the latest software, and ethernet library has been updated by the library management through the ide. Do I need a different library? Any ideas what is causing this?

Thank you so much in advance for your help!

RedLightning: I have tried changing the CS pin to 9, 6, 5, and 3

Unless that shield is very non-standard, it should be 10.

RedLightning: Do I need a different library?

The latest version (2.0.0) of the official Arduino Ethernet library does support W5200. Since you are able to set the CS pin, I can tell you're using Ethernet 2.0.0. I have had some intermittent problems with the W5200. When I was testing the Ethernet library, I found the W5200 shield worked on my Uno and Leonardo, but not on my Mega. The W5200 did work in all cases using this library: https://github.com/Seeed-Studio/Ethernet_Shield_W5200 so you might want to give that a try.

Thanks pert.

I also found this.

https://forum.arduino.cc/index.php?topic=316764.15

I placed this code in the setup code block and the shield worked.

define PWDN 9 // Connected to GND through a 10k resistor (R13)

define nINT 3 // Connected to 3V3 through a 10k resistor (R6)

define nRST 8 // Connected to 3V3 through a 10k resistor (R4)

pinMode(nRST,OUTPUT); //the others two pins are not necessary, just there to rememeber how they are connected. digitalWrite(nRST,LOW); //Reset W5200 delay(10); digitalWrite(nRST,HIGH); delay(200); // wait W5200 work

My question now, is do I have to reset the shield just on start or any time I need to recommunicate with it over spi? There are desolderable connections on the shield for PWDN, nINT, and nRST.

What would be the purpose of desoldering the PWDN or nINT. If the shield only needs to be reset on start, would it be a good idea to wire nRST to the arduino reset?

Good work! I'm really surprised that the shield has those connections. I haven't seen that before. My W5200 shield is from Seeed and I don't think it does any of that. It's very annoying that there is no documentation on the pin connections on the robotshop.com product listing page. They even have a "datasheet", which is really light on any useful information. I'd think it would be common sense that the most critical information to provide about a shield is the pin connections but time and again I find the sellers of Arduino shields omit that information.

I've thought it might be handy to have a connection to the interrupt pin but I've never tried it. I do have a project where I made a connection to the reset pin on the Ethernet module just as a belt and suspenders sort of thing so the Arduino could reset the Ethernet controller if it stopped communicating and all else failed. The PWDN pin could be useful to save power if you had a project where the Arduino didn't need to have continuous access to incoming Ethernet communication.

RedLightning: My question now, is do I have to reset the shield just on start or any time I need to recommunicate with it over spi?

I'd say just on start, and if there was a problem where the Ethernet controller stopped responding.

RedLightning: What would be the purpose of desoldering the PWDN or nINT.

Free up pins 9 and 3 on your Uno so that you can use them for something else.

RedLightning: would it be a good idea to wire nRST to the arduino reset?

I'm not sure. The concern I have is whether the Uno's auto-reset circuitry will work correctly to reset both the ATmega328P on the Uno and the W5200. You could try it out by temporarily making the connection with a jumper wire. You can prevent shield pins from connecting to the Uno by removing the shield and then gently bending the shield pin out so that it misses the female header on the Uno. You should be careful to bend the pin the least amount possible as repeated sharp bends back and forth will weaken the metal of the pin over time and it may eventually break off.

So I did some testing with the shield, and here are my results.

The library you gave me worked great. I was able to use it on an Arduino Uno and Arduino Mega 2560 without a problem.

pert: The W5200 did work in all cases using this library: https://github.com/Seeed-Studio/Ethernet_Shield_W5200 so you might want to give that a try.

As for wiring the nRST pin to the Arduino's reset pin, it worked great if I only used the ethernet part of the shield. If I tried to use SD card, and then switch back to ethernet, it appeared not to reconnect with the ethernet part. However, it may have been my programming that might have messed it up, and not necessarily the reset pin. I had the shield working with the library you gave me and wasn't too worried about trying to gain an extra pin for the Arduino.

I do recommend using the standard Ethernet library if possible, since there have been a lot of improvements made to it compared to the unmaintained Seeed Studio library. A potential disadvantage of using the Ethernet library is it may use significantly more memory that other libraries (you’d need to make a comparison to see what the actual difference is in your application). Some of this extra overhead of the Ethernet library is caused by the automatic chipset detection code used to provide support for W5100, W5200, and W5500.

There is also this library supplied by the manufacturer of the W5200:

By default, it is configured for use with the W5500. To use it with the W5200, you would need to uncomment line 18 of w5100.h and comment line 19:
https://github.com/Wiznet/WIZ_Ethernet_Library/blob/master/Arduino IDE 1.5.x/Ethernet/src/utility/w5100.h#L18-L19

#define W5200_ETHERNET_SHIELD // WIZ820io, W5200 Ethernet Shield 
//#define W5500_ETHERNET_SHIELD   // WIZ550io, ioShield series of WIZnet