My Arduino Nano can't get a reply from my new ENC28J60 Ethernet Shield - I can't get any library examples to work. Using the UIPEthernet lib, and running the EchoServer example with logging turned up, I get:
ENC28J60::init DEBUG:csPin = 10 ENC28J60::init DEBUG:miso = 12 ENC28J60::init DEBUG:mosi = 11 ENC28J60::init DEBUG:sck = 13 ENC28J60::init DEBUG:Use Native hardware SPI Enc28J60Network::writeOp(uint8_t op, uint8_t address, uint8_t data) DEBUG_V3:Function started ENC28J60::init DEBUG_V3:Before readOp(ENC28J60_READ_CTRL_REG, ESTAT) Enc28J60Network::readOp(uint8_t op, uint8_t address) DEBUG_V3:Function started ...
so it gets nicely into the Enc28J60Network::init function. But shortly after, it does a phyWrite, tries to read a response, and then times out.
ENC28J60::init DEBUG_V3:Before phyWrite(PHCON2, PHCON2_HDLDIS) Enc28J60Network::phyWrite(uint8_t address, uint16_t data) DEBUG_V3:Function started ... lots of attempts to read Enc28J60Network::phyWrite ERROR:TIMEOUT !!
And then it all starts to fail, and it never gets better. I tried the EtherCard lib, too, and it fails in a similar way.
I put the scope on the SPI pins, and I see reasonable stuff: activity on SCK and MOSI, nothing on MISO, and the SS (pin 10) switching ok - and the shield claims to use pin 10 (I briefly tried pin 8 as I flailed in confusion, but no luck there either).
So at this point, either I'm misunderstanding something, or the shield is DOA.
Update: Earlier, I strongly suspected the SCK line because it showed a very poor signal on my scope. But it turned out to be poor grounding on the scope probe, and the signal was actually fine, a red herring. Thanks to @Majenko for drawing my attention to it.
Update 2: After getting no SPI response from the shield under any circumstances, my working hypothesis is that it was DOA. I've gone back to my UNO with W5100: all working fine. I have ordered more Nano ethernet shields, to arrive in a week or two, so I'll try with those, and provide updates/answers then.