#Looking for troubleshooting help w/ ST7789 TFT display module

1 messages · Page 1 of 1 (latest)

desert mulch
#

I'm hoping to get some help getting a generic TFT 240x240 screen module working with Circuit Python.

When I run my test program (provided later), I see the backlight power on, but I never get anything to show on the display.

I have never seen the screen module work, so there is the possibility that it is a dud.

Here is my setup:

Components:

  • Xiao RP2040
  • 1.3 in. TFT 240x240 screen module using a ST7789 IC (generic / not branded)

Connections (Xiao -> ST7789):

  • 3V3 -> VCC
  • GND -> GND
  • SCK (D8) -> SCK
  • MOSI (D10) -> SDA
  • MISO -> n/c
  • CSn (D7) -> n/c
  • D0 -> RES
  • D1 -> DC

Connection/Troubleshooting Notes:

  • ST7789 also has a "BLK" pin which is left unconnected. Also tried connecting it to 3V3, but no change.
  • All connections are made using jumper wires.
  • All connections have been confirmed from pin of Xiao to pin of ST7789 module using a multimeter.
  • Xiao is known to be working, as I have used it to run other programs.
  • The ST7789 module is getting 3v3 power, confirmed with a multimeter.

Image Link: https://universalsolder.b-cdn.net/wp-content/uploads/2020/06/2480_1c8a9548-3010-4c89-9351-398bde8e10470.jpg

#

Example code:

import board
import terminalio
import displayio

# Starting in CircuitPython 9.x fourwire will be a seperate internal library
# rather than a component of the displayio library
try:
    from fourwire import FourWire
except ImportError:
    from displayio import FourWire
from adafruit_display_text import label
from adafruit_st7789 import ST7789

displayio.release_displays()

spi = board.SPI()
while not spi.try_lock():
    pass
spi.configure(baudrate=24_000_000)
spi.unlock()

tft_cs = board.D7 # NOTE: not connected
tft_res = board.D0
tft_dc = board.D1

display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_res)

display = ST7789(display_bus, width=240, height=240, rowstart=0)

splash = displayio.Group()

color_bitmap = displayio.Bitmap(240, 240, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0x00FF00  # Bright Green

bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)

display.root_group = splash

print("done!\n")
while True:
    pass
#

Example was mostly taken from examples I found related to the lib.

I'm wondering if I have a connection wrong or if the code has a problem.

If not, I guess my next step is to try a test program for the screen using Arduino IDE / C++ and see if I can get that to work...

void gust
#

What happens when you remove the following?

    pass
spi.configure(baudrate=24_000_000)
spi.unlock()```

In almost all cases where I've used an ST7789 in a RPi Pico (RP2040), I haven't had to configure the SPI.
desert mulch
#

I ran it without that previously - that was one of the things I was trying to get it working

#

I removed that bit and re-tried, just in case - no change.

desert mulch
#

Well, the screen module is certainly OK. I set up a test sketch with the Arduino IDE with the same hardware and wiring, and the sketch works great.

It does seem to be a CircuitPython specific problem 🤔