rpi4-osdev/part14-spi-ethernet
Adam Greenwood-Byrne 7c871b0266 Fix photo location
2021-11-07 18:36:03 +00:00
..
boot Starting part14 write-up 2021-11-07 18:35:17 +00:00
images Fix photo location 2021-11-07 18:36:03 +00:00
include Starting part14 write-up 2021-11-07 18:35:17 +00:00
kernel Starting part14 write-up 2021-11-07 18:35:17 +00:00
lib Starting part14 write-up 2021-11-07 18:35:17 +00:00
net Starting part14 write-up 2021-11-07 18:35:17 +00:00
Makefile Starting part14 write-up 2021-11-07 18:35:17 +00:00
Makefile.gcc Starting part14 write-up 2021-11-07 18:35:17 +00:00
README.md Starting part14 write-up 2021-11-07 18:35:17 +00:00

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