0

Please somebody who had the same issue help me. The question is how to connect this Mini Ethernet shield to an Arduino. The main problem is the pins that my shield have or haven't; my current connections to the Arduino Mega 2560 are:

  1. 5v to 5v
  2. GND to GND
  3. LNT to NULL
  4. CLK to NULL
  5. SO to pin50
  6. WOL to NULL
  7. SLK to PIN52
  8. ST to ????
  9. RST to RST
  10. CS to PIN53
  11. Q3 to NULL
  12. GND to NULL

But in all cases when I search the connection diagram every picture has SI, but I don't have it (I tried to connect ST to PIN51 without luck).

What kind of Ethernet shield is that? Or how to connect those pins?

I hope someone can help me; thank you in advance.

/*
  DHCP-based IP printer

  This sketch uses the DHCP extensions to the Ethernet library
  to get an IP address via DHCP and print the address obtained.
  using an Arduino Wiznet Ethernet shield.

  Circuit:
   Ethernet shield attached to pins 10, 11, 12, 13

  created 12 April 2011
  modified 9 Apr 2012
  by Tom Igoe
  modified 02 Sept 2015
  by Arturo Guadalupi

 */

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

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = {
  0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02
};

void setup() {
  // You can use Ethernet.init(pin) to configure the CS pin
   // Ethernet.init(53);  // Most Arduino shields
  //Ethernet.init(5);   // MKR ETH shield
  //Ethernet.init(0);   // Teensy 2.0
  //Ethernet.init(20);  // Teensy++ 2.0
  //Ethernet.init(15);  // ESP8266 with Adafruit Featherwing Ethernet
  //Ethernet.init(33);  // ESP32 with Adafruit Featherwing Ethernet

  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // start the Ethernet connection:
  Serial.println("Initialize Ethernet with DHCP:");
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    if (Ethernet.hardwareStatus() == EthernetNoHardware) {
      Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    } else if (Ethernet.linkStatus() == LinkOFF) {
      Serial.println("Ethernet cable is not connected.");
    }
    // no point in carrying on, so do nothing forevermore:
    while (true) {
      delay(1);
    }
  }
  // print your local IP address:
  Serial.print("My IP address: ");
  Serial.println(Ethernet.localIP());
}

void loop() {
  switch (Ethernet.maintain()) {
    case 1:
      //renewed fail
      Serial.println("Error: renewed fail");
      break;

    case 2:
      //renewed success
      Serial.println("Renewed success");
      //print your local IP address:
      Serial.print("My IP address: ");
      Serial.println(Ethernet.localIP());
      break;

    case 3:
      //rebind fail
      Serial.println("Error: rebind fail");
      break;

    case 4:
      //rebind success
      Serial.println("Rebind success");
      //print your local IP address:
      Serial.print("My IP address: ");
      Serial.println(Ethernet.localIP());
      break;

    default:
      //nothing happened
      break;
  }
}

And result is :

  • 16:41:14.242 -> Initialize Ethernet with DHCP:
  • 16:41:14.804 -> Failed to configure Ethernet using DHCP
  • 16:41:14.848 -> Ethernet shield was not found. Sorry, can't run
    without hardware. :(
  • ST is SI. what is the chip? what library do you use? did you init the library for 53 as CS? – Juraj Mar 14 at 10:02
  • I use <SPI.h> and <Ethernet.h>, Sketch for DHCP Client which is integrated in arduino examples. Ethernet > DHCPAddressPrinter and it shows me on serial monitor Ethernet shield was not found. Sorry, can't run without hardware. :(" – AleksAnderson IT Mar 14 at 12:10
  • I assigned pin 53 to CS too but still nothing :( – AleksAnderson IT Mar 14 at 12:13
  • I asked about chip . I suspect you try to use the Ethernet library with the enc28j60 chip – Juraj Mar 14 at 12:36
  • @Juraj Sorry for that. Yes you are right I use enc28j60 Chip. – AleksAnderson IT Mar 14 at 12:40
1

The "Mini Ethernet Shield" uses ENC26j60 chip. The Arduino Ethernet library is for Wiznet W5100/W5200/W5500 chips. You can't use it with ENC26j80.

With Arduino Mega I would recommend to use the UIPthernet library for ENC26j80. Other option is the EtherCard library.

The UIPEthernet library has the same API as the the Arduino Ethernet library.

  • I think you are right, I used wrong library and now I tested with UIPethernet.h and it works great. Thank you Juraj. – AleksAnderson IT Mar 14 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.