Mega & enc28j60

Hi, everybody!

Trying to connect ENC28J60 module to me Mega and no success.
Using latest EtherCard library from github.

After

if (ether.begin(sizeof Ethernet::buffer, mymac, 53) == 0) { 
         Serial.println(P("Failed to access Ethernet controller")); } 
        else { Serial.println(P("Ethernet is fine and up"));}`

I'm getting "Failed to access Ethernet controller".

DHCP Failed also.

Leds on enc28j60 are working. Link is on and Ack is blinking.

Tried to use external power supply for 3.3V, the same result.

It seems like SPI is not initialised.

Please help :slight_smile:

The IDEs 'built in' library is not for ENC...

http://www.homautomation.org/2014/10/27/how-to-choose-the-right-library-to-add-ethernet-enc28j60-to-your-arduino/

I'm using EtherCard library from https://github.com/jcw/ethercard
Also tried UIPethernet

I had luck with this: GitHub - ntruchsess/arduino_uip: UIPEthernet: A plugin-replacement of the stock Arduino Ethernet library for ENC28J60 shields and breakout boards. Full support for persistent (streaming) TCP-connections and UDP (Client and Server each), ARP, ICMP, DHCP and DNS. Build around Adam Dunkels uIP Stack. Further developed version can be found on https://github.com/UIPEthernet/UIPEthernet

No luck :frowning: I've tried all mentioned libraries - UIPEthernet, EtherCard and even old Ethershield & ENC_28j60. Shield not working. I think smth wrong with shield itself or with spi on arduino (in fact clone of Arduino).

Tomorrow will buy w5100 shield and try with embedded library.