rpi4-osdev/part14-spi-ethernet/README.md
2021-11-07 18:35:17 +00:00

1.9 KiB

Writing a "bare metal" operating system for Raspberry Pi 4 (Part 14)

Bare metal Ethernet for under £10

It's exciting to build your own OS, but until you give it the ability to communicate with the outside world, your possibilities are limited. Indeed, our simple Bluetooth comms got us up and running - but if we're to do anything meaningful then we need proper networking.

In this tutorial, we're going to connect to an external Ethernet controller (a network card, if you like) using the RPi4's Serial Peripheral Interface (SPI).

Things you'll need:

Connecting up the ENC28J60 Ethernet module

I followed the very helpful instructions here.

We won't be connecting the interrupt line for now, so there are just six jumper leads (I've suggested colours) that need connecting:

Pi pin Pi GPIO Jumper colour ENC28J60 pin
Pin 17 +3V3 power Red VCC
Pin 19 GPIO10/MOSI Green SI
Pin 20 GND Black GND
Pin 21 GPIO09/MISO Yellow SO
Pin 23 GPIO11/SCLK Blue SCK
Pin 24 GPIO08/CE0 Green CS

GPIO location

Here's a (not very useful) photo of my RPi4 connected correctly:

ENC28J60 connections