Page 1 of 1

Ethermega setup issue

Posted: Sat Oct 06, 2018 10:24 pm
by regis
What is the proper way to enable the Wiznet W5100 and disable to SD card on the Ethermega?

Re: Ethermega setup issue

Posted: Sun Oct 07, 2018 1:49 am
by csconsulting
I have my wiznet doing ICMP, UDP and HTTP all on one sketch and it works fine, but you have to do some specific setup.
I use my SD card, so my code is a bit different.
I set up the SD card FIRST, then enable ethernet.
If you aren't using the SD card, write a HIGH to pin 4.

First, on power up of your sketch, before you do anything, delay (1000); to allow the chip to power up.

Then i do this:

pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(10, LOW);

this cycles CS on the chip.

Then run your ethernet begin:

Ethernet.begin(mac, ip, dnss, gateway, subnet);

Then delay another 4 seconds.

then: server.begin();


This has been from months of debugging Wiznet 5100 shields from ebay which can sometimes be a bit flaky.

Following this procedure has allowed me to reliably start up the wiznet chip 100 percent of the time, both after hard power cycle, soft reset and reprogramming.