Pirate Audio ST7789 Blank Display

I’ve used this for a year or so but one day it stopped working. I haven’t been able to get it working since. It seems that maybe the board no longer works properly. All that works is the backlight, which I can control.
This looks to be the pinout: Pirate Audio Line Out at Raspberry Pi GPIO Pinout

I re-soldered my pins and re-imaged my Micro SD with a fresh install of 32-bit Raspberry Pi OS Lite on my Raspberry Pi 0W v1.1.

My /boot/config.txt below

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
# Run as fast as firmware / board allows
arm_boost=1

[all]

I’ve tested my pins and they seem to be okay.

curl http://abyz.me.uk/rpi/pigpio/code/gpiotest.zip -O
unzip gpiotest.zip
wget https://github.com/joan2937/pigpio/archive/master.zip
unzip master.zip
cd pigpio-master
make
sudo make install
./gpiotest
This program checks the Pi's (user) gpios.

The program reads and writes all the gpios.  Make sure NOTHING
is connected to the gpios during this test.

The program uses the pigpio daemon which must be running.

To start the daemon use the command sudo pigpiod.

Press the ENTER key to continue or ctrl-C to abort...

Testing...
Skipped non-user gpios: 0 1 28 29 30 31
Tested user gpios: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Failed user gpios: None

I’ve tried this i2cdetect tool, but see nothing in the output, which maybe seems strange?

john@raspberrypi:~ $ i2cdetect -l
i2c-1   i2c             bcm2835 (i2c@7e804000)                  I2C adapter
i2c-2   i2c             bcm2835 (i2c@7e805000)                  I2C adapter
john@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
john@raspberrypi:~ $ i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Using GitHub - pimoroni/st7789-python: Python library to control an ST7789 240x240 1.3" TFT LCD display., I’ve tried this script, which just flashes the backlight off for a moment.

from PIL import Image, ImageDraw
from ST7789 import ST7789


image = Image.open('./st7789-combined.jpg').resize((240, 240))
draw = ImageDraw.Draw(image)

st7789 = ST7789(
    rotation=90,  # Needed to display the right way up on Pirate Audio
    port=0,       # SPI port
    cs=1,         # SPI port Chip-select channel
    dc=9,         # BCM pin used for data/command
    backlight=13,
    spi_speed_hz=80 * 1000 * 1000
)

st7789.display(image)

This turns off the backlight.

# https://pinout.xyz/pinout/pirate_audio_line_out#
# $ pinout
# need to lower PWM to GPIO 13 (33)
# button Pins: https://github.com/pimoroni/pirate-audio/blob/master/examples/buttons.py

import RPi.GPIO as GPIO


GPIO.setmode(GPIO.BCM)
# we'll have GPIO package deal with BCM (Broadcom GPIO 00..nn numbers)
# rather than BOARD (Raspberry Pi board numbers)
GPIO.setup(13, GPIO.OUT)  # set BCM pin 13 to output a signal
backlight_pin = GPIO.PWM(13, 500)  # set BMC pin 13 to pulse signal waves high(on)/low(off) modulated at 500Hz frequency (500 times a second)
backlight_pin.start(100)  # for each pulse cycle, the signal should be high (on duty) for 100% of the cycle; duty-cycle = 100%
backlight_pin.ChangeDutyCycle(50)  # for each pulse cycle, the signal should be high for 50% of the cycle; duty-cycle = 50%

backlight_pin.stop()

The only setting in your config.txt that really matters display wise, for this display, is if SPI is enabled. Plus, it’s not going to display Boot info etc unless you have set it up to do so.

The Pirate Audio doesn’t use i2c so nothing being detected there isn’t unusual.

The audio part is done via i2s.

As per the pinout it uses SPI0 and CS1. The backlight function is a seperate function done via PWM.

Try this example,
pirate-audio/rainbow.py at master · pimoroni/pirate-audio (github.com)

Alright, SPI, i2c, and now i2s is enabled and Pi is rebooted. Btw, GitHub - pimoroni/st7789-python: Python library to control an ST7789 240x240 1.3" TFT LCD display. does say to enable i2c.

dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on

No errors or issues or Python tracebacks with rainbow.py or any other ST7789 scripts I’ve tried, but nothing displayed on the screen but backlight & black :( Just blinks the screen when the Python script hits the ST7789 class.

$ curl https://raw.githubusercontent.com/pimoroni/pirate-audio/master/examples/rainbow.py -O
$ python rainbow.py
rainbow.py - Display a rainbow on the Pirate Audio LCD

This example should demonstrate how to:
1. set up the Pirate Audio LCD,
2. create a PIL image to use as a buffer,
3. draw something into that image,
4. and display it on the display

You should see the display change colour.

Press Ctrl+C to exit!

I have a Pirate Audio Speaker. The display part should be identical to yours. I’ll dig that Pi out and do some tinkering tomorrow. I’ll post back here what I find. Mine is running a really old version of Raspbian. I think I’ll swap in a spare SD card with the current Pi OS on it. I have been wanting to do something with that display.
Mine is currently setup as an itty bitty beat box. The display is currently blank / not used.
Build an Itty Bitty Beat Box (pimoroni.com)

I didn’t forget, but as luck would have it my grand daughter came over for a visit. And proceeded to play with the itty bitty beat box most of the time she was here. I had built it for her in the first place. ;)

I will try and have a look see some time today though.

Really appreciate it! Now that I think about it, I guess it may have been after a ‘sudo apt update && sudo apt upgrade -y’. I had traveled and set up some new things to use the Pi as a camera to watch my dog in the hotel room for a bit and noticed that it didn’t work then. I figured maybe my shoddy soldering got loosened while traveling. I booted the Pi with that legacy Rasperry Pi camera attached, which I also thought maybe could’ve changed something somehow. But, I’m surprised I wasn’t able to resolve it starting from scratch again. I will try a fresh install 1 more time this afternoon and I do have a 4b I could try it on too.

What were you displaying on the screen, when it was working?

I had been using this package to drive the display: GitHub - juj/fbcp-ili9341: A blazing fast display driver for SPI-based LCD displays for Raspberry Pi A, B, 2, 3, 4 and Zero
So it showed tty1, which was fun to play around with. Here’s one of my write-ups: Tips-Tricks/fbcp-ili9341-SPI-Display-Pirate-Audio2.md at master · treatmesubj/Tips-Tricks · GitHub

Ah, I had a feeling it was something like that. Doing an apt upgrade can break that functionality.

That’s what I figured, but now I’m stumped that I can’t even get the test scripts in GitHub - pimoroni/st7789-python: Python library to control an ST7789 240x240 1.3" TFT LCD display. to work on a fresh install, so I’m not sure if I somehow damaged the hardware or have lost my mind ha. I will test again more this afternoon. I am probably just missing something small.

I am going to try running the display examples on my setup latter on today. Too much other family related stuff on the at the moment.

Swapped in a spare Pi Zero2 with a fresh install of Pi OS. Did an update upgrade and all was well. Opened Chromium and tried to access the Pimoroni sight and it crashed, kernel panic I think? All down hill from there. Might have been the SD card though, it errored the first time I tried to image it.
I’ll regroup and retry and get back to you. That’s the way it goes some times.

No luck on the Raspberry Pi 4B with fresh install of 64bit lite, either - I can only blink the screen and turn the back-light off with PWM. No errors/tracebacks with any of the test scripts.

rock@raspberrypi:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
rock@raspberrypi:~$ uname -m
aarch64
rock@raspberrypi:~$ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
# Run as fast as firmware / board allows
arm_boost=1

[all]
rock@raspberrypi:~$

I’m imaging another spare SD card i have. Also dug out a a spare Zero W I had hidden away in a box of spare stuff.
Will have another go at this tomorrow some time.

Ok, booted up, enabled SPI and i2c via raspberry Pi configuration and rebooted.
Then I followed the links to here,

Did the
sudo pip3 install st7789
and
git clone https://github.com/pimoroni/st7789-python
I then went to the examples folder and ran the scrolling text example.

It ran just fine with no edits. I didn’t touch my config.txt file, no need to for the basic functionality.

Dang, alright. Well, maybe it’s time for a new one. Thanks for checking

Have you tried it on more than one Pi?

Yeah, Pi 0w1.1 32bit lite and Pi 4b 64bit lite

Ok, I should have went back and looked before asking. I can see mention of that. I was on my XBOX replying with a game controller / onscreen keyboard.

That’s a bummer. I’ve had one LCD failure on a Tufty, and that was replaced free of charge. I have bunches of the Pimoroni ones, breakout garden stuff mostly. I can use those on a Pi or Pico. Some Pico display packs too.

The Pirate Audio Speaker was a substitute for the no longer available Speaker Phat. When it came to doing something with the display I couldn’t find my round 2it. ;)

How’d you go about contacting them for a replacement? I made good use of mine for a while & don’t have a receipt or anything. I don’t think mine warrants a replacement, but I’d send it in if they offered one.