Skip to content

Screen is blank unless I use gc9a01py first. #56

@arizonagroovejet

Description

@arizonagroovejet

This issue seems very strange to me so I'm going to explain what I've done from the start in case it’s relevant.

I've got a cheap 1.28" round display from AliExpress hooked up to an ESP32 C3 Super Mini. I put stock MicroPython on the board, downloaded gc9a01py and had a play with the examples to confirm the display works.

As this version of the driver provides more functionality I flashed the board with ESP32_GENERIC_C3/firmware_4MiB.bin, worked out a tft_config.py and tried some of the examples. They worked as expected.

Later, having unplugged the ESP32 board from my computer, I plugged it back in and tried an example again. It didn’t work. No errors appeared in Thonny, but the display remained blank. This was very puzzling.

I uploaded gc9a01py to the board and then tried a simple test I had saved from earlier which I knew had worked.


from machine import Pin, SPI
import gc9a01py as gc9a01
from machine import I2C
import time

spi = SPI(1, baudrate=60000000, sck=Pin(4), mosi=Pin(3))

##### there is no backlight so set to unconnected pin
tft = gc9a01.GC9A01(
      spi,
      dc=Pin(2, Pin.OUT),
      cs=Pin(1, Pin.OUT),
      reset=Pin(0, Pin.OUT),
      backlight=Pin(7, Pin.OUT),
      rotation=180)

tft.fill(gc9a01.BLUE)

The screen went all blue as expected. Which was a relief. I then went back to the examples from this driver and they worked. This was very puzzling.

I've established that after power up, nothing will appear on the display using this driver unless I first do something with the display using gc9a01py. After looking at both drivers a bit to see if I could spot something gc9a01py is doing that looks like it would wake the display up or something, I’ve concluded I have no idea what I’m doing.

tft_config.py

from machine import Pin, SPI
import gc9a01

TFA = 0
BFA = 0
WIDE = 0
TALL = 0

##### there is no backlight so set to unconnect pin

def config(rotation=0, buffer_size=0, options=0):
    """Configure the display and return an instance of gc9a01.GC9A01."""

    spi = SPI(1, baudrate=60000000, sck=Pin(4), mosi=Pin(3))
    return gc9a01.GC9A01(
        spi,
        240,
        240,
        reset=Pin(0, Pin.OUT),
        cs=Pin(1, Pin.OUT),
        dc=Pin(2, Pin.OUT),
        backlight=Pin(7, Pin.OUT),
        rotation=rotation,
        options=options,
        buffer_size=buffer_size
    )

Do you have any advice or suggestions of what is going on here?

Thank you for making this driver. Looking around the Internet I find myself wondering how anyone uses this sort of display with MicroPython without your work. While looking around I found this
https://www.waveshare.com/wiki/ESP32-S3-LCD-1.28#Working_with_MicroPython
and thought these examples look exactly like that ones from the driver I found on GitHub.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions