Ethernet port stopped working-RESOLVED

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]
Joined:Mon Apr 20, 2020 2:46 am
Ethernet port stopped working-RESOLVED

Post by Yutenji » Mon Apr 20, 2020 3:12 am

Update/edit, 21 Apr 2020:
I changed the external power supply from a 5v 2.4A to 12v 5A, and now it works fine. I would be more embarrassed about this simple solution, but the fact that the main board powered up even on the lower supply, and even the Ethernet port had worked fine on a lower supply until recently, really convinced me that it wasn't a power supply issue. It must have been right on the threshold of the power requirement: the main board had enough power to start, but the Ethernet port didn't.

Anyway, despite my embarrassment, I'll leave this post here in case anyone is unlucky enough to have the same problem. :oops:

- - - - - - - - - - - -
Hi. Recently (I can't be very specific, but within the last 6 months) code that worked fine on the Ethermega now fails to setup/initialise the ethernet port.

The leds on the port don't light up, there is no IP address assigned via DHCP (nor when I assign a static IP in the code).
I have tried:
- Reducing the code to a bare minimum (sort of, "Hello world" for testing ethernet. Below, for reference). Didn't work.
- Using different IP address and MAC addresses. Didn't work.
- Tried 3 different ethermega boards, including one brand-new straight out of the box. None of them work.
- Tried the same bare minimum code on an EtherTen. It works fine.
- Tried different ethernet cables. Didn't help, and actually the test with the EtherTen kinda proved the cables aren't the problem.
- I'm aware of the issue posted on the Freetronics website, regarding the delay needed to allow the ethernet chip to fire up on the Ethermega. I've implemented that. Didn't help. ... p0R_1MzZMM
- Code that doesn't need the ethernet port runs fine on the Ethermegas, so I don't think it's an upload problem.

I'm grasping at straws now for what the problem might be. The only things I can think of is a very subtle change in the Arduino libraries, or the Arduino IDE. But I would have thought issues there would have be showing up on the internet and/or this forum.

Any suggestions?

Testing code, below. Works on EtherTen, not on Ethermega

Code: Select all

#include <SPI.h>
#include <Ethernet.h>
byte mac[] = {
  0xDE, 0x05, 0x0C, 0xC, 0x01, 0x17 // assign a MAC address for the ethernet controller.
void setup() {
  delay(150);   // allow some time (150 ms) after powerup and sketch start, for the Wiznet W5100 Reset IC to release and come out of reset.

void loop() {

Post Reply