No DHCP from enc28j60

Hello. having hard time with my enc28j60 small shield for arduino uno.
This is 3rd day pulling my hair.

I googled whole internet with no answer to fix my issue.
I have connected my
I have ethercad included and testDHCP shows only mac adress. my router does not dedect the enc28j60.
(enc28j60 is written on the pcb not on the chip)

my wiring is

gnd gnd
vcc 3.3v
cs pin 8
si pin 11
so pin 12
sck pin 13

with this wiring it never worked for me. I just changed wiring from cs to pin 10.
and boom, dhcp worked fine and I can create webserver and it worked fine.

today nothing changed it does not work anymore.
no matter what wiring diagram I use.

Wierd thing is with 3.3v and testdhc code. I get nothing
with 3.3v and with static ip code, I get nothing
with 5v and static IP, my router dedects the IP I gave it, but I cannot ping it still.
with 5v and DHCP I get nothing.

the backsoon code, with DHCP I get nothing I give it static IP and serial monitor outputs
[backSoon]
IP: 192.168.8.200
GW: 192.168.8.1
DNS: 0.0.0.0

but I cannot ping that IP, router shows it that that is the IP for arduino

with DHCP serial monitor only gives [backsoon] text.
I have tried many different cat5e and cat6 cables. does not matter.

// Present a "Will be back soon web page", as stand-in webserver.
// 2011-01-30 <jc@wippler.nl>
//
// License: GPLv2

#include <EtherCard.h>

#define STATIC 1  // set to 1 to disable DHCP (adjust myip/gwip values below)

#if STATIC
// ethernet interface ip address
static byte myip[] = { 192,168,8,200 };
// gateway ip address
static byte gwip[] = { 192,168,8,1 };
#endif

// ethernet mac address - must be unique on your network
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[500]; // tcp/ip send and receive buffer

const char page[] PROGMEM =
"HTTP/1.0 503 Service Unavailable\r\n"
"Content-Type: text/html\r\n"
"Retry-After: 600\r\n"
"\r\n"
"<html>"
  "<head><title>"
    "Service Temporarily Unavailable"
  "</title></head>"
  "<body>"
    "<h3>This service is currently unavailable</h3>"
    "<p><em>"
      "The main server is currently off-line.
"
      "Please try again later."
    "</em></p>"
  "</body>"
"</html>"
;

void setup(){
  Serial.begin(57600);
  Serial.println("\n[backSoon]");

  // Change 'SS' to your Slave Select pin, if you arn't using the default pin
  if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
    Serial.println( "Failed to access Ethernet controller");
#if STATIC
  ether.staticSetup(myip, gwip);
#else
  if (!ether.dhcpSetup())
    Serial.println("DHCP failed");
#endif

  ether.printIp("IP:  ", ether.myip);
  ether.printIp("GW:  ", ether.gwip);
  ether.printIp("DNS: ", ether.dnsip);
}

void loop(){
  // wait for an incoming TCP packet, but ignore its contents
  if (ether.packetLoop(ether.packetReceive())) {
    memcpy_P(ether.tcpOffset(), page, sizeof page);
    ether.httpServerReply(sizeof page - 1);
  }
}
// Arduino demo sketch for testing the DHCP client code
//
// Original author: Andrew Lindsay
// Major rewrite and API overhaul by jcw, 2011-06-07
//
// License: GPLv2

#include <EtherCard.h>

static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[700];

void setup () {
  Serial.begin(57600);
  Serial.println(F("\n[testDHCP]"));

  Serial.print("MAC: ");
  for (byte i = 0; i < 6; ++i) {
    Serial.print(mymac[i], HEX);
    if (i < 5)
      Serial.print(':');
  }
  Serial.println();

  // Change 'SS' to your Slave Select pin, if you arn't using the default pin
  if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
    Serial.println(F("Failed to access Ethernet controller"));

  Serial.println(F("Setting up DHCP"));
  if (!ether.dhcpSetup())
    Serial.println(F("DHCP failed"));

  ether.printIp("My IP: ", ether.myip);
  ether.printIp("Netmask: ", ether.netmask);
  ether.printIp("GW IP: ", ether.gwip);
  ether.printIp("DNS IP: ", ether.dnsip);
}

void loop () {
  ether.packetLoop(ether.packetReceive());
}

Ideas?
It worked fine yesterday, but not today anymore.

Did you read the comment in the code you posted?

  // Change 'SS' to your Slave Select pin, if you arn't using the default pin
  if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)

I guess you didn't as you don't use the standard SS pin but you didn't define SS to hold the pin you used.

Try cs to pin 10

pylon:
Did you read the comment in the code you posted?

  // Change 'SS' to your Slave Select pin, if you arn't using the default pin

if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)




I guess you didn't as you don't use the standard SS pin but you didn't define SS to hold the pin you used.

knut_ny:
Try cs to pin 10
GitHub - njh/EtherCard: EtherCard is an IPv4 driver for the ENC28J60 chip, compatible with Arduino IDE

I guess you did not read my post.

"with this wiring it never worked for me. I just changed wiring to cs to pin 10.
and boom, dhcp worked fine and I can create webserver and it worked fine."

Like I said, everything worked fine for 30min I tested, I left it and next day powered everything up again, not working anymore.
I cannot get IP from router with 3.3v
I put 5v and change dhcp to static IP, I can see the IP in router settings, but cannot ping the IP

Check your wires and the connections (p.e. breadboard)! May be a broken wire or and otherwise bad connection between the Arduino and the ENC28j60. Although not very probable, your ENC28j60 may have died.