SERIAL PERIPHER AL INTERFACE
Driving SPI displays
Let’s go on an adventure into the SPI protocol, LCD displays and model trains with Sean Conway toot-tooting away!
OUR EXPERT
Sean Conway uses Raspberry Pi projects to fulfil his desire to explore electronics while having fun.
YOU NEED
Raspberry Pi Model 3B+
SD card 8GB or more
Pimoroni 1.3-inch SPI colour LCD (240x240)
BR (Digi-Key PIM476)
Raspberry Pi OS Lite (4 Mar 21+)
Python ST7789 library to control an ST7789 TFT LCD display
Pillow Python Imaging Library
S PI is a synchronous serial communication interface specification that was developed by Motorola in the mid-1980s to provide fullduplex (transmit/receive data in both directions) synchronous serial communication between controller and peripheral devices. Synchronous in protocols means that the communication is controlled by a controller (the Raspberry Pi) that talks to the peripheral – in this case an LCD device.
The SPI protocol defines no special bits to manage data. Limiting this overhead allows for high-speed data streaming. To provide some flexibility in communication, the serial clock has two options – Clock Polarity (CPOL) and Clock Phase (CPHA) – which, when configured, establish one of four modes.