SERIAL PERIPHERAL INTERFACE: Driving SPI displays
Linux Format|December 2021
Let’s go on an adventure into the SPI protocol, LCD displays and model trains with Sean Conway toot-tooting away!
Sean Conway
SERIAL PERIPHERAL INTERFACE: Driving SPI displays

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

SPI is a synchronous serial communication interface specification that was developed by Motorola in the mid-1980s to provide full duplex (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.

In mode 0, data input/output occurs at the rising edge of the clock signal, where the clock polarity is low. For mode 1, data input/output occurs at the falling edge of the clock signal, where the clock polarity is low. To engage mode 2, data input/output occurs at the falling edge of the clock signal, where the clock polarity is high. In mode 3, data input/output occurs at the rising edge of the clock signal, where the clock polarity is high. CPOL and CPHA values are specified as ‘0’ or ‘1’ to form the four unique modes.

この記事は Linux Format の December 2021 版に掲載されています。

7 日間の Magzter GOLD 無料トライアルを開始して、何千もの厳選されたプレミアム ストーリー、9,000 以上の雑誌や新聞にアクセスしてください。

この記事は Linux Format の December 2021 版に掲載されています。

7 日間の Magzter GOLD 無料トライアルを開始して、何千もの厳選されたプレミアム ストーリー、9,000 以上の雑誌や新聞にアクセスしてください。

LINUX FORMATのその他の記事すべて表示
Create your first WebSocket service
Linux Format

Create your first WebSocket service

Mihalis Tsoukalos explains how to use the Go programming language to work with the WebSocket protocol.

time-read
9 分  |
April 2023
Fantastic Mr Firefox
Linux Format

Fantastic Mr Firefox

Nick Peers takes a trip down memory lane to reveal the story behind the rise - and slight fall - of Mozilla's popular web browser.

time-read
9 分  |
April 2023
Set up your terminal and email like it's 1983
Linux Format

Set up your terminal and email like it's 1983

Jump in the hot terminal time machine with Mats Tage Axelsson who emails from the command line using the latest technology.

time-read
8 分  |
April 2023
Universal layer text effects with GIMP
Linux Format

Universal layer text effects with GIMP

Posters use them, films and presentations are hard to imagine without them: text effects. Attract attention with Karsten Günther and GIMP.

time-read
8 分  |
April 2023
Jump to a federated social network
Linux Format

Jump to a federated social network

Nick Peers reveals how you can get up and running with this free, decentralised and non-profit alternative to Twitter.

time-read
9 分  |
April 2023
Free our SOFTWARE!
Linux Format

Free our SOFTWARE!

Taking anything for granted is dangerous, so Jonni Bidwell and Mike Saunders revisit how the free software movement got started to help free us from proprietary tyranny!

time-read
4 分  |
April 2023
Master RPI.GPIO
Linux Format

Master RPI.GPIO

Les Pounder goes back to the early days of the Raspberry Pi - and his career with this classic library! -

time-read
5 分  |
April 2023
Waveshare Zero to Pi3
Linux Format

Waveshare Zero to Pi3

Transform your Pi Zero into a Pi 3, they promised Les Pounder, but it's more like adding on go-faster stripes.

time-read
2 分  |
April 2023
The Best OPEN SOURCE Software Ever!
Linux Format

The Best OPEN SOURCE Software Ever!

In an attempt to trigger controversy, Michael Reed and Neil Mohr unequivocally state these are the greatest free software apps ever. Probably. We’re just trying to be helpful.

time-read
10+ 分  |
April 2023
Linux-Mandrake 7
Linux Format

Linux-Mandrake 7

Simplicity and a wide range of applications make this a great distribution for all Linux users.

time-read
2 分  |
April 2023