EFE_net - Practical training

By Wolfgang Keller
Draft
Originally written 2018-06-02
Last modified 2022-06-08

Table of contents

ICs and boards for connecting to Ethernet networks

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:

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:

ICs and boards for connecting to Wi-Fi® networks

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).

Projects

W5100S

TODO

ENC28J60

ENC28J60 pinout

By the data sheet linked above, the pins of the ENC28J60 are as follows:

Pin # SPDIP,
SSOP, SOIC
Pin # QFN Name Type Connect to
125VCAPIn (Power)Power (GND with filter capacitator of ≈10 μF (minimum 1 μF) inbetween)
226VSSIn (Power)Power (GND)
327CLKOUTOutMCU (optional)
428INTOutMCU
51NCN.C. (Out)N.C. (Out)
62SOOutMCU (SPI)
73SIInMCU (SPI)
84SCKInMCU (SPI)
95CSInMCU (SPI)
106RESETInMCU (optional)
117VSSRXIn (Power)PHY RX (GND)
128TPIN-InEthernet Transformer
139TPIN+InEthernet Transformer
1410RBIASInPower (GND with resistor of 2.32 kΩ, 1% inbetween)
1511VDDTXIn (Power)PHY TX (+3.3V)
1612TPOUT-OutEthernet Transformer
1713TPOUT+OutEthernet Transformer
1814VSSTXIn (Power)PHY TX (GND)
1915VDDRXIn (Power)PHY RX (+3.3V)
2016VDDPLLIn (Power)PHY PLL (+3.3V)
2117VSSPLLIn (Power)PHY PLL (GND)
2218VSSOSCIn (Power)OSC (GND)
2319OSC1InOSC (Input)
2420OSC2OutOSC (Output)
2521VDDOSCIn (Power)OSC (+3.3V)
2622LEDBOutLED B
2723LEDAOutLED A
2824VDDIn (Power)Power (+3.3V)
Pinout of the ENC28J60

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
VSSIn (Power)Power (GND)
VDDIn (Power)Power (+3.3V)
SOOutMCU (SPI)
SIInMCU (SPI)
SCKInMCU (SPI)
CSInMCU (SPI)
INTOutMCU (optional)
CLKOUTOutMCU (optional)
RESETInMCU (optional)
Pins of the ENC28J60 to connect to the MCU

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].

Connecting to the Arduino Uno

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/GNDGNDpower supply
VDD/VCC3.3V
SCK13SPI
SO12
SI11
CS10
Pins of the ENC28J60 to connect to the Arduino UNO

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].

LAN8720A

TODO