PDA

View Full Version : Arduino Mega and ENC28J60 Ethernet Shield problems!?!?


waverz
04/18/2012, 08:09 PM
Trying to get more features going on my DIY controller and am getting no love from my ENC28J60 Ethernet Shield and Mega combo. I've tried several libraries, several example codes but can't ever seem to get a ping response from it.

I've got it plugged into my router assign it an ip but no ping.

Anyone with this combo actually have it working?

I really want to be able to upload my data to pachube but w/o the shield working I'm stuck.

der_wille_zur_macht
04/19/2012, 11:45 AM
Many of us with Hydras are using an AVR talking to an ENC chip, but not the same AVR as on your Mega.

That said, I bet you'll get way more response on the Arduino forum itself...

waverz
04/19/2012, 04:15 PM
One would think. Didn't get a single reply their either. Apparently this is not a popular option for Mega users.

der_wille_zur_macht
04/20/2012, 07:33 AM
Huh. Sorry to hear that.

Which shield are you using? Are you sure the pinout is correct for the SPI interface on the Mega? If it's a shield intended for a "normal" Arduino it'll be using the wrong pins.

waverz
04/20/2012, 08:28 AM
Huh. Sorry to hear that.

Which shield are you using? Are you sure the pinout is correct for the SPI interface on the Mega? If it's a shield intended for a "normal" Arduino it'll be using the wrong pins.

It's from nuelectronics and is "Mega compatible" I have tried other pin options but they didn't appear to do anything.

Pretty frustrating but I'm not going to give up just yet.

der_wille_zur_macht
04/20/2012, 08:50 AM
From the Arduino playground:

On the Arduino Duemilanove and other ATmega168 / 328-based boards, the SPI bus uses pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK). On the Arduino Mega, this is 50 (MISO), 51 (MOSI), 52 (SCK), and 53 (SS).

Looking at nu's website, the shield doesn't even have pin headers near where those pins would be on a Mega. Where/how did you hear that it was mega compatible?

I suppose you could forgo the shield mounting position, put the shield next to the Mega, and use jumper wires to connect to the correct pins...

disc1
04/20/2012, 01:42 PM
But the shield I got doesn't use those pins. It uses the six pin connector down at the end of the board for spi. 10 is still SS but 11, 12, and 13 are unused.

der_wille_zur_macht
04/20/2012, 01:47 PM
That strikes me as really terrible design - to allow for the usually-hardwired pins to be variable, but to hardwire the one pin in the protocol that's SUPPOSED to be variable? :facepalm:

waverz
04/20/2012, 04:09 PM
From the Arduino playground:



Looking at nu's website, the shield doesn't even have pin headers near where those pins would be on a Mega. Where/how did you hear that it was mega compatible?

I suppose you could forgo the shield mounting position, put the shield next to the Mega, and use jumper wires to connect to the correct pins...

I apologize, I meant Ekitzone not nuelectronics.
http://www.ekitszone.com/p/8/enc28j60-ethernet-shield-for-arduino-mega-mega2560

disc1
04/20/2012, 08:36 PM
That strikes me as really terrible design - to allow for the usually-hardwired pins to be variable, but to hardwire the one pin in the protocol that's SUPPOSED to be variable? :facepalm:

They do that to maintain compatibility between the UNO and MEGA. Since SS has to be declared separately in code and they want you to be able to easily use code from one platform to the other. When working with the UNO, pins 11, 12, and 13 would still be unavailable simply because you are using SPI, but on the MEGA it gives those back to you however 51 - 53 are made unavailable and 54 must remain an output.

If they used the SS pin on the ICSP header, you would have to change the SS pin in any code that was being moved between the two platforms.

disc1
04/21/2012, 11:45 AM
I'm sorry, that's completely wrong. It's because there isn't a SS pin on the ICSP header. I thought there was but that pin is reset.

fsamir
06/14/2012, 02:27 AM
Has anyone solved that?
I am also struggling with the same shield (enc28j60 mega).

I also have the smaller version of the same ehternet shield (was a pain in the as to make it work) which works fine with this lib:
http://jeelabs.net/projects/cafe/wiki/EtherCard
I only had to hange the jumper in the board from pin 10 to 8.

Unfortunately, the same library doesn't work with the ethernet mega, most probably because it doesn't have a jumper to switch to pin 8.