Ethermega setup issue

Combining the power of the ATmega2560 MCU with onboard Ethernet, a microSD card slot, an efficient switchmode power supply, and a small prototyping area. [Product page]
Post Reply
Joined:Tue Mar 08, 2016 4:11 pm
Ethermega setup issue

Post by regis » Sat Oct 06, 2018 10:24 pm

What is the proper way to enable the Wiznet W5100 and disable to SD card on the Ethermega?

Joined:Fri Sep 21, 2012 7:22 am

Re: Ethermega setup issue

Post by csconsulting » Sun Oct 07, 2018 1:49 am

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);
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.

Post Reply