Lessons and the learning game

Systems of boards

Designs with more than one processor: UART links, a shared addressed bus, SPI in software, a Pi with an Uno, framed protocols, and a two-board rover.

Take the course at /learn/path/multi-processor-systems. It is an advanced course: it assumes the Uno course.

The benches

Each lesson builds its own system: two or three Unos, or a Raspberry Pi 4 and an Uno, joined pin to pin with a shared ground. Every board prints to the same serial monitor, so you can read both ends of every conversation. The serial links use SoftwareSerial on pins 10 (RX) and 11 (TX).

The lessons

Why split work. A busy Uno counts 1 press of 5; a helper Uno counts all five.

UART between MCUs. A crossed link, TEMP? and its answer in tenths of a degree, timeouts, and a baud mismatch.

A shared bus with addresses. A master and two nodes; the nodes answer through diodes onto a pulled-up line, each only when called, with addresses from a jumper.

SPI master and slave. A 10 kHz bit-banged master and a slave written on two interrupts; full duplex and the one-transfer lag.

Pi plus microcontroller. The Pi as SPI master in Python with spidev, a resistor divider for the Uno's 5 V MISO, and who should do what.

Shared protocols. Frames with a start byte, sequence number, type, length and CRC-8; ACK, NAK and retries.

Boss: a coprocessor display. A rover brain that drives and decides, and a dashboard Uno with an LCD and a park button, joined by framed packets.

The sketches

Sketch What it does
mpxbrain, mpxhelper A busy board and a helper watching one button
mpxlinka, mpxlinkb A UART question and answer
mpxbusm, mpxnode The shared bus master and its nodes
mpxspim, mpxspis A slow SPI master and a software SPI slave
mpxframea, mpxframeb The framed link with ACK, NAK and retries
mpxrover, mpxdash The rover brain and its dashboard

The Pi lesson's Python is in the lesson's own main.py.

What the simulation leaves out

Two things are not modeled. One board answering as an I2C target (Wire.onReceive and Wire.onRequest): the catalog's I2C target lesson is replaced by the shared bus lesson, the same addressed request and answer built from a UART and diodes. And the Uno's hardware SPI block: the slave is written in software, which only keeps up with a slow clock. The ESP32-C3 does not appear: on it, every UART shares the serial monitor rather than its pins, so it cannot be one end of a pin-to-pin link here. Several boards running at once make these lessons slower to simulate than one-board ones.

The Arduino Uno and the Raspberry Pi course, for the Pi side.