I'm trying to get a waveshare 4.2inch E-Ink Display Module Compatible with Raspberry Pi 4B/3B+/3B/2B/B+/A+/Zero/Zero W/WH/Zero 2W Series Boards 400x300 Resolution SPI Interface working on a Raspberry Pi Zero 2 W that already has a Pimoroni Keybow Mini on it. I can get it working on SPI0, but that conflicts with the pin usage of the Keybow, so now I'm trying to get it working on SPI1. I've got the following pin mappings:
Display | PIN | BCM |
---|---|---|
VCC | 17 | 3.3V |
GND | 25 | GND |
DIN | 38 | GPIO 20, SPI1 MOSI |
CLK | 40 | GPIO 21, SPI1 SCLK |
CS | 12 | GPIO 18, SPI1 CE0 |
DC | 22 | GPIO 25 |
RST | 16 | GPIO 23 |
BUSY | 18 | GPIO 24 |
I had to move the RST off GPIO 17, since that's used by the Keybow, so it's on GPIO 23 now. That works fine when the display is on SPI0, so I know it works in general.
I've changed epdconfig.py
to have the following pin settings:
# Pin definition
RST_PIN = 23 #17
DC_PIN = 25
CS_PIN = 18 #8
BUSY_PIN = 24
#PWR_PIN = 18
MOSI_PIN = 20 #10
SCLK_PIN = 21 #11
I commented out all of the PWR_PIN usage, since there's no wire for it anyway. I've also set the SPI object to use SPI 1.0:
# SPI device, bus = 1, device = 0
self.SPI.open(1, 0)
The example program runs, but nothing displays on the waveshare. Any ideas?
(It seems the Keybow is fully hardwired, so my only option is to mess with the display.)
EDIT: SPI1 enabled like so in /boot/firmware/config.txt
:
# SPI1 for display
dtoverlay=spi1-1cs