W5500 Communication issues

fanzypantz
Posts: 5
Joined: Thu Jul 15, 2021 10:25 am

W5500 Communication issues

Postby fanzypantz » Mon Feb 07, 2022 11:52 am

Hi, I'm trying to add a W5500 on my custom ESP32 board and I am getting weird issues.

Before talking about it here is the schematics:
Image
Image

With the regular Ethernet library it doesn't seem to be able to pick up that this is the W5500 chip. It stops around this area and returns 0 on the very first readMR():

Code: Select all

uint8_t W5100Class::isW5500(void)
{
	chip = 55;
	Serial.println("w5100.cpp: detect W5500 chip");
	if (!softReset()) return 0;
	Serial.println("Softreset worked");
	writeMR(0x08);
	if (readMR() != 0x08) return 0;
	Serial.println("First read");
	writeMR(0x10);
	if (readMR() != 0x10) return 0;
	Serial.println("Second read");
	writeMR(0x00);
	if (readMR() != 0x00) return 0;
	int ver = readVERSIONR_W5500();
	Serial.print("version=");
	Serial.println(ver);
	if (ver != 4) return 0;
	//Serial.println("chip is W5500");
	return 1;
}
I am also getting some weird behaviour when I hold down the EN button. The RJ45 connector LED light up and the activity LED blinks.. The SS pin reads around 2.6V at that point. But never when the regular code runs. Now I'm not sure where to test to figure out what the issue is.

For reference the code, the regular ESP32 setup is in another file:

Code: Select all

#include <Arduino.h>
#include <SPI.h>
#include <Ethernet.h>


// Update these with values suitable for your network.
byte mac[]    = {  0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress ip(10, 0, 0, 198); // 10.0.0.138
IPAddress serverIp(134, 122, 95, 249);


EthernetClient ethClient;
PubSubClient client(serverIp, 1883, callback, ethClient);

void connectEtherneth() 
{ 
    Serial.println("Starting ETHERNET connection...");
    Ethernet.init(ETHERNET_CS_PIN);
    if(!Ethernet.begin(mac)) {
        Serial.println("Ethernet initialising failed");
    }
    delay(1500);

    Serial.print("Link status");
    Serial.println(Ethernet.linkStatus());

    Serial.print("Hardware status");
    Serial.println(Ethernet.hardwareStatus());

    Serial.print("Ethernet IP is: ");
    Serial.println(Ethernet.localIP());
}

void setupEthernet() 
{  
   connectEtherneth();
}

Edit:
I've looked at some other schematics for some shields: https://www.pusr.com/support/downloads/usr-es1-sch

They seem to differ a decent amount from those I found on EasyEDA. Is my schematic unviable?

Who is online

Users browsing this forum: No registered users and 118 guests