Trouble Connecting ENC28J60 Ethernet Shield to Arduino Nano ESP32

I'm facing difficulties connecting an ENC28J60 Ethernet shield to an Arduino Nano ESp32. I've mounted the Arduino Nano on top of the Ethernet shield.

I'm using the EthernetENC library, I've tried using both CS port 5 and 10 for SPI communication, but the shield is not being detected.

tested using
if (Ethernet.hardwareStatus() == EthernetNoHardware) {}

  1. Double-checked wiring connections.
  2. Verified SPI pins and CS ports.
  3. Tried alternative CS ports (5 and 10).
  4. Checked for conflicts with mounted Arduino Nano.

Additional Notes:

The shield is powered using the 3.3V from Arduino Nano. And the Ethernet indicator lights are active.
Am I missing something?

did you modify the shield for 3.3 V?

No, sorry I didn't modify the shield, it's just stacked onto the Arduino nano esp32. Should I modify it? the shield is a cheap (see below)
image

for the red shield I don't have the modification procedure yet. esp32 usually doesn't smoke with 5 V pull-up on io pins so the shield should work.

Ok, thanks! Then somthing else is not working, any idea's?
Should i focus on code or is it still a hardware thing (maby pinout?)

I found this to be the standerd pinout an im assuming this can mount on the arduino nano ESP32 without switching pins around.

ENC28J60 Pin Arduino Nano Pin
CS D10 or D5
SI (MOSI) D11
SO (MISO) D12
SCK D13
INT D2
VCC 3.3V
GND GND

that shield connects to the 5 V pin if put on the Nano. the shields converts the 5 V to 3.3 V to power the components.

Using the code below my program halt at the Ethernet.begin(mac) line, what could cause this?

byte mac[] = {  0xDE, 0xFF, 0xBA, 0xFE, 0xFE, 0xED };
IPAddress ip(172, 16, 0, 100);
IPAddress myDns(192, 168, 0, 1);

Ethernet.init(10);
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // Check for Ethernet hardware present
    if (Ethernet.hardwareStatus() == EthernetNoHardware) {
        Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
        while (true) {
            delay(1); // do nothing, no point running without Ethernet hardware
        }
    }
    if (Ethernet.linkStatus() == LinkOFF) {
        Serial.println("Ethernet cable is not connected.");
    }
} else {
    Serial.print("  DHCP assigned IP ");
    Serial.println(Ethernet.localIP());
}

// If DHCP fails or if DHCP was successful but you want to use a static IP, configure using the static IP
if (Ethernet.hardwareStatus() != EthernetNoHardware) {
    Ethernet.begin(mac, ip, myDns);
}

there is a 1 minute timeout waiting for DHCP response

Oh, sorry, I meant after the timeout, nothing else gets executed.

my new library

1 Like

Please, do not cut pieces out of the code.
Now we can not see which header file you are using