Ethermega setup issue
Ethermega setup issue
What is the proper way to enable the Wiznet W5100 and disable to SD card on the Ethermega?
-
- Posts: 71
- Joined: Fri Sep 21, 2012 7:22 am
Re: Ethermega setup issue
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.
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.