By Wolfgang Keller
Draft
Originally written 2018-06-02
Last modified 2022-06-08
In this tutorial, we use the following microcontroller boards:
Note that the former uses 5 V power levels while the latter uses 3.3 V. If you apply a power level of 5 V to the RP2040 microcontroller, it will likely become destroyed.
For ethernet, we use the following ICs/boards:
W5100S:
Documents: Document | WIZnet Document System [visited 2022-05-21T13:37:10Z]
A board in the form factor of a Raspberry Pi Pico HAT is available at
According to its description, this board supports both 3.3 V and 5 V, and can thus be connected both the Arduino Uno Rev 3 and Raspberry Pi Pico.
ENC28J60:
Documents:
Board: A board that supports both 3.3 V and 5 V: ENC28J60 Ethernet Shield LAN Netzwerk Modul kompatibel mit Arduino – AZ-Delivery [visited 2022-05-27T23:04:50Z].
AZ-Delivery also offers an ebook for free on how to connect this board to an Arduino:
LAN8720A:
Files:
For the differences:
In this sense, the order given here is in increasing order of difficulty of implementing the software, and thus the order in which we will do the projects.
Software:
Just in case that you want to connect Wi-Fi® to your Raspberry Pi Pico, here a list of ICs and board (these are not of further relevance for this text since we work with Ethernet; rather, this list is intended as support to the reader).
WizFi360:
ESP32:
TODO
By the data sheet linked above, the pins of the ENC28J60 are as follows:
Pin # SPDIP, SSOP, SOIC |
Pin # QFN | Name | Type | Connect to |
---|---|---|---|---|
1 | 25 | VCAP | In (Power) | Power (GND with filter capacitator of ≈10 μF (minimum 1 μF) inbetween) |
2 | 26 | VSS | In (Power) | Power (GND) |
3 | 27 | CLKOUT | Out | MCU (optional) |
4 | 28 | INT | Out | MCU |
5 | 1 | NC | N.C. (Out) | N.C. (Out) |
6 | 2 | SO | Out | MCU (SPI) |
7 | 3 | SI | In | MCU (SPI) |
8 | 4 | SCK | In | MCU (SPI) |
9 | 5 | CS | In | MCU (SPI) |
10 | 6 | RESET | In | MCU (optional) |
11 | 7 | VSSRX | In (Power) | PHY RX (GND) |
12 | 8 | TPIN- | In | Ethernet Transformer |
13 | 9 | TPIN+ | In | Ethernet Transformer |
14 | 10 | RBIAS | In | Power (GND with resistor of 2.32 kΩ, 1% inbetween) |
15 | 11 | VDDTX | In (Power) | PHY TX (+3.3V) |
16 | 12 | TPOUT- | Out | Ethernet Transformer |
17 | 13 | TPOUT+ | Out | Ethernet Transformer |
18 | 14 | VSSTX | In (Power) | PHY TX (GND) |
19 | 15 | VDDRX | In (Power) | PHY RX (+3.3V) |
20 | 16 | VDDPLL | In (Power) | PHY PLL (+3.3V) |
21 | 17 | VSSPLL | In (Power) | PHY PLL (GND) |
22 | 18 | VSSOSC | In (Power) | OSC (GND) |
23 | 19 | OSC1 | In | OSC (Input) |
24 | 20 | OSC2 | Out | OSC (Output) |
25 | 21 | VDDOSC | In (Power) | OSC (+3.3V) |
26 | 22 | LEDB | Out | LED B |
27 | 23 | LEDA | Out | LED A |
28 | 24 | VDD | In (Power) | Power (+3.3V) |
Remark: In many older schematics the NC pin (pin 5 (SPDIP, SSOP, SOIC) or 1 (QFN)) is instead called WOL (Wake On LAN). The ability to use this pin for Wake On LAN only existed in older chip revisions of the ENC28J60. Now for this functionality, the INT pin is used.
For our application it is very important that all SPI input pins (CS, SCK, SI), as well as RESET, are 5V tolerant, so we don't need a level shifter for the inputs. Note however that the output pins SI, CLKOUT and INT use 3.3V as high.
This leaves the following pins for us to connect with Power and MCU (ordered by category):
Name | Type | Connect to |
---|---|---|
VSS | In (Power) | Power (GND) |
VDD | In (Power) | Power (+3.3V) |
SO | Out | MCU (SPI) |
SI | In | MCU (SPI) |
SCK | In | MCU (SPI) |
CS | In | MCU (SPI) |
INT | Out | MCU (optional) |
CLKOUT | Out | MCU (optional) |
RESET | In | MCU (optional) |
Under https://arduino-hannover.de/2013/12/08/mein-paket-ein-enc28j60-ethernet-lan-netzwerk-modul/ [visited 2018-03-12T13:32:54Z], one can find a description of a module based on the ENC28J60. Here are three Arduino libraries for it:
A comparison between EtherCard and UIPEthernet (and ETHER_28J60) can be found at http://www.tweaking4all.com/hardware/arduino/arduino-enc28j60-ethernet [visited 2018-05-07T20:16:48Z].
In the README file of EtherCard [visited 2018-06-03T11:34:47Z] and its documentation , one can find the following instructions to connect the ENC28J60 to the Arduino UNO:
Pin Name ENC28J60 | Pin # Arduino Uno | Type |
---|---|---|
VSS/GND | GND | power supply |
VDD/VCC | 3.3V | |
SCK | 13 | SPI |
SO | 12 | |
SI | 11 | |
CS | 10 |
If you are interested in further details why these are the natural pins for SPI on the Arduino Uno, read the text of Arduino's SPI library [visited 2018-06-03T12:10:05Z].
TODO