4 · Displays & buses
Understanding the SPI bus
Advanced20 min
Goal
Exchange a byte as SPI master and observe the 4 wires.
Why it matters
MOSI, MISO, SCK, CS: SPI is full-duplex, unlike I²C.
Steps
- 01Add an SPI peripheral (TFT or SD card).
- 02SPI.begin() inside setup(), CS as OUTPUT.
- 03Pull CS low, send SPI.transfer(0x9F), raise CS.
- 04Print the answer in hexadecimal.
This tutorial runs inside the Circuitly simulator: your wiring and your code are checked automatically at every step.