W5200 ethernet shield and Mega 2560 - Help please before I kill it

Hi all

I am at my wits end and very close to throwing my Arduino an ethernet shield at a very hard wall unless someone can save my frazled brain

I have an Arduino 2560, a W5100 shield and a W5200 shield to replace it with for better performance

With the old 5100 I have written lots of sketches and can get it running fine. But, it is limited in performance and wanted to improve things with a 5200

So, bought this shield http://www.ebay.co.uk/itm/172153910144?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT , fitted it and downloaded the Ethernet V2_0 library

In my existing sketches I change the #include <Ethernet.h> to #include <EtherentV2_0.h> but nothing works.
SD doesn’t initialise and see any files and ethernet port doesn’t work. The lights on the shield and RJ45 socket come on but nothing works

Now I have gone back to first principles and uploaded simple examples from the EthernetV2_0 library (webserver and Webserver wtith SD) and they fail too. Webserver just says that IP of the sever is 0.0.0.0 and the one with SD just fails to initialise the SD card

I have included an extra line in those sketches of pinMode(53,OUTPUT) for the mega’s hardware SS pin

Please can anybody help. I am sure I am just being dim but I am so frustrated with the thing its unreal.

thanks in advance
Julian

I use the library provided by Wiznet, and it has proven to be reliable for the W5100/W5200/W5500 ICs. https://github.com/Wiznet/WIZ_Ethernet_Library

Download and unpack. Navigate to where your sketches are stored, and you will find a folder called "libraries". Create a folder named "Ethernet" there and copy the contents of the "Arduino IDE v1.5.x" folder from the library download.

Open the /utility/W5100.h file and change the #define to W5200.

When you compile your code, you should get a notice that the IDE found two ethernet libraries, and tell you it is using your new library and ignoring the default.

Remove the SD card until you have the W5200 starting correctly. I can get you running after that.

edit: Insure the ICSP pins are seated correctly when you mount the shield on the Arduino. That is how the SPI pins connect. If they are not seated fully, that will cause your problem.

Great, thanks for the swift reply I will have a go very shortly

Just a hint: If you do the library install I described above, the IDE will advise you that it has an update for the ethernet library. DO NOT UPDATE! It will overwrite your new library with the default.

Once again, check those ICSP pins to insure you have a good connection.

edit: I don't know why the Arduino crew has not adopted this new library. It would eliminate a lot of headaches. I am currently using it with a W5100, and other users are reporting it works well with the W5200 and W5500 as long as you change the define to the appropriate Wiznet IC.

Ok, I have been playing with two Arduinos (the Mega and an old UNO) and two ethernet shield, my old W5100 and this new W5200

I have installed the new library and am using the webserver example from it

If I use the W5100 on the UNO (with W5100 included in the config file) it works fine

If use the W5200 on the UNO (and W5200 included in the file and recmompiled) I get "server is at 255.255.255.255"

I unmounted the W5200 from the UNO and connected it with six wires from the ISCP header on the W5200 to the header on the UNO, plus wires from pin 4 & 10 on the W5200 to 4 & 10 on the UNO

Most of the time I still had 255.255.255.255 but then it sprang into life and started running fine

Reset it and stopped working again

Then I tried the W5100 on the Mega with W5100 included in the file and recompiled - again works fine

Then I tried the W5200 on the Mega with W5200 included in the file and recompiled - fails with Server is at 0.0.0.0 and nothing I can do makes it change

Tried connecting the W5200 to the Mega with wires as I had with the UNO, still no change, behaves the same as when it was stacked on the Mega

It is getting very close to being thrown on the fire at this rate as it seems to be a pretty useless piece of kit and £20 wasted

Sounds like a bad connection. Check the ICSP pin solder joints on the Mega and shield.