Pages: [1]   Go Down
Author Topic: Connecting ENC28J60 to an arduino  (Read 980 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 47
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I recently bought this breakoutboard.

But im having a hard time understanding how to interface it. I understand its an SPI device, but the Nueltronics' shield and schematics include a SN74HCT08D(QUAD 2-Input AND gate). Is this needed to connect it properly?

Any help or links would be much appreciated.

-Thomas
Logged

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Funnily enough, I just spent all yesterday building one of these from scratch on a protoboard.

I'm not sure if the AND gates are really needed.  They are used to boost two of the signals (INT and MISO) up to 5V, but the Arduino should work perfectly fine with 3.3V inputs.

I added the AND gates on mine, but I am tempted to try it without.

Oh, and the library doesn't work on 1.0 without some small modifications. (changes to header files - remove avr headers and add Arduino.h)
Logged

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 47
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What a coincidence!
Would you mind sharing your knowledge on how you connect it? Im really rather new to the whole hardware side of electronics.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You connect it as per the schematic.  MISO, MOSI and SCK are connected as per any SPI device (see the Arduino pages for the pinout for your deivce).  The INT connection pin goes to (on the UNO) digital pin 2. CS goes to digital pin 10.  Note, this may differ on other Arduinos and Arduino clones.

Here's my build of it:



The extra black box is the magnetics - I didn't have a magjack, so I had to use the traditional method smiley-wink

If you decide to implement the AND gate (it may be needed, I'm not sure), then the pinout of a typical and gate chip is:



Connecting the two inputs of a gate together basically turns it into a level shifter,  Link pins 1&2 and connect them to the INT connection of the ethernet card.  Pin 3 then goes to D2.  The same with pins 4&5 to SDO and 6 to MISO.  Pin 7 is ground, and pin 14 is +5V.
« Last Edit: January 14, 2012, 05:41:50 am by majenko » Logged

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

0
Offline Offline
Shannon Member
****
Karma: 159
Posts: 10409
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

An example known-good schematic using the ENC28J60 is the Nanode, which is open source hardware, details here: http://solderpad.com/monsonite/nanode/   They use a level shifter for the ENC28J60's SO output to drive MISO, and its tristate controlled from the pin used for chip select...  Perhaps the ENC28J60 doesn't obey the SPI protocol?  Check the datasheets.
Logged

[ I won't respond to messages, use the forum please ]

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have the same board (thanks Santa)
I read up on the different voltage levels of the board and the Arduino as well as on using the ethercard or EtherShield library.

In the end based on advice from http://www.electrodragon.com/?p=1112 I just wired it up directly and it works perfectly.
The ENC28J60 is tolerant of the 5V from the Arduino and the Arduino is tolerant of the 3.3v from the ENC28J60.

I did a bit of a blog post on the wiring needed for the different libraries here.  This explains how to wire up for the nuelectronics library and also the ethercard library.
http://winkleink.blogspot.com/2012/01/arduino-enc28j60-ethernet-module-part-2.html

I hope this helps.
Albert.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have embarked on a complete re-write of the library for the ENC chip.  I aim to make it support multiple connections to multiple ports concurrently - much more socket library like, while still  maintaining the object-orientated goodness of C++.

It's not a small task, but worth it I think.  I'll keep you posted.
Logged

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

Pages: [1]   Go Up
Jump to: