Wiring Teensy 3.1 and ENC28J60 Ethernet Module Together

The teensy is pretty cool, but with all that processing power, it needs to be able to do more than turn pins on and off to communicate. If I’m going to use this for anything truly useful, I’ll want it to send information over a network.

In this experiment, I figure out how to wire an ENC28J60 ethernet module to the Teensy 3.1. This is a 3.3V module and should work with the Teensy 3.0 as well, but don’t take my word for it – I haven’t tested it.

I have written about the ENC28j60 before. I have used it several times with an Arduino Nano. Depending on the software library, I’ve been able to get it to act as a client or server for both TCP and UDP. This link points to a recent blog entry regarding the ENC28J60:


The ENC28J60 I am using for this project is a bit different from the others I have used in the past. It is NOT an Arduino Nano shield. It is just a little stand-alone module. It looks about like this:


I purchased mine from eBay from a seller located in the US for about the going Chinese price:


Mine didn’t have mounting holes. Next time I’ll make sure I find one with holes.

I went searching the web for instructions on interfacing the Teensy to the ENC28J60. I didn’t find anything, but I did find someone who had interfaced the Teensy to a normal Arduino ethernet shield. CLOSE ENOUGH! Here is a link to those instructions:


Using those instructions, and the pin descriptions on the two boards, I came up with this wiring diagram:


You might find the official Teensy Pinout chart useful as well:

Wired up, it looks like this. You can click on the pic to get a much bigger version:


Once I had it wired, I then opened the UIPEthernet TCP Server example code. I simply changed the IP address to something that would work on my local network and compiled/uploaded.

Worked great! Pinged and connected to it on the first try.

This entry was posted in c-tinys and tagged , . Bookmark the permalink.

7 Responses to Wiring Teensy 3.1 and ENC28J60 Ethernet Module Together

  1. Hi. Could you give a link where to download UIPEthernet library.
    I’ve got the library here https://github.com/ntruchsess/arduino_uip/archive/master.zip
    No luck yet with ethernet. Wired as you described, compiles fine but no ping no nothing.

  2. Dan TheMan says:

    Check that the CS pins on your ethernet card match the pin in the software. I vaguely recall having problems in certain circumstances because the hardware didn’t match the software.

  3. Did you use the same library that I did?

  4. Dan TheMan says:

    yes, I got the library from the same place though I’m not sure they were the same version. I did a little tracking thru the software to figure out what pin is being used.

    If you look at utility\Enc28J60Network.h(30): you will find that they are using “SS” as the CS pin:

    #define ENC28J60_CONTROL_CS SS

    It took some searching to find where SS is defined, but I found it in a file called pins_arduino.h. There, SS is defined as pin 10. So the software expects the shield to be using pin 10.

    In the example above, you will see that I connect PIN 9 of the ethernet card to PIN 10 of the Nano. Since the ethernet card I’m using is not a shield, that is not a problem.

    Look at your ethernet card/shield and see if you can figure out which pin it is using as CS. I’m willing to bet it isn’t 10. It is probably 9.

    If you find they don’t match, you will either have to change the software or do something like I did where I was able to connect pin 10 to pin 9.

    I could have sworn there was a way when you initialized the library to specify the CS pin (for example ethernet.begin(9), but I cannot find a way to do it. You may only be able to change it by changing the constant in the pins_arduino.h file. A sloppy way to fix the problem, but it should work.

    Also, you might want to do a Serial.println(SS) before you initialize the network just to be sure it is the value you really want.

  5. You said Nano. You mean Teensy 3.1. Right?
    And here is one more stupid question.
    I feed the setup with USB 5V. Is it Ok to feed 3V to ENC28J60 just from Teensy Pin24 ?

    • Dan TheMan says:

      Doh! Sorry, I was also looking at where I had used an ENC28J60 with a Nano and got confused. But that clarifies for me that you are not using a shield. But the same applies – find out the correct CS pin you need. For the teensy, the pins_arduino should be in the hardware/teensy/avr/cores/teensy3/. Looking at that file, it expects to use pin 10 as well.

      So connect pin 10 on the Teensy to the CS pin on the EN28J60. The other pins there should really not be any issues with. Just remember the OUT pin on the teensy goes to the IN pin on the ENC28J60 and the IN pin on the teensy goes to the OUT pin.

      Yes, you can feed 3.3V from Teensy to the ENC28J60.

      You might also want to consider using the wiz820IO. It can sit on top of the teensy. This is supported directly by PJRC and, while not as cheap as the ENC28J60, it is still only $21. I’ve been using it in my current teensy project with very few issues. It implements the TCP stack itself, reducing CPU cycles required by the teensy.


  6. Thank you Dan for your patience. It works like a charm now. It was a hardware fault.
    I did not solder Teensy Pin13 properly. No software magic was needed.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s