adafruit / Adafruit_CircuitPython_SSD1680

CircuitPython `displayio` driver for SSD1680-based ePaper displays
MIT License
7 stars 7 forks source link

display.refresh() hangs infinitely #13

Open jmodrako opened 1 year ago

jmodrako commented 1 year ago

Hey!

I'm using an e-ink display that is supported by this library. I've checked and call to display.refresh() stops and paused forever.

Do you have any clue what could be wrong?

Here is my code:

import time
import board
import displayio
import adafruit_ssd1680

displayio.release_displays()

# This pinout works on a Metro M4 and may need to be altered for other boards.
spi = board.SPI()  # Uses SCK and MOSI
epd_cs = board.D41
epd_dc = board.D40
epd_reset = board.D39  # Set to None for FeatherWing
epd_busy = board.D42  # Set to None for FeatherWing

print("1")

display_bus = displayio.FourWire(
    spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)

print("2")
time.sleep(1)

# For issues with display not updating top/bottom rows correctly set colstart to 8
display = adafruit_ssd1680.SSD1680(
    display_bus,
    colstart=8,
    width=250,
    height=122,
    busy_pin=epd_busy,
    highlight_color=0xFF0000,
    rotation=270,
)

print("3")

g = displayio.Group()

print("4")

with open("/display-ruler.bmp", "rb") as f:
    pic = displayio.OnDiskBitmap(f)

    print("5")

    # CircuitPython 6 & 7 compatible
    t = displayio.TileGrid(
        pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
    )

    print("6")

    # CircuitPython 7 compatible only
    # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
    g.append(t)

    print("7")

    display.show(g)

    print("8")

    display.refresh()

    print("refreshed")

    time.sleep(120)
makermelissa commented 1 year ago

Can you open a serial terminal to the device? It might give you more information about the error.

ylihemmo commented 1 year ago

I have exactly the same issue. Serial does not give any information. It just hangs and needs to be reset via button.

tannewt commented 1 year ago

Try the example without setting the busy pin. It may not be hooked up right.

ylihemmo commented 1 year ago

It does not get stuck without busy pin but it does not display properly either.

ylihemmo commented 1 year ago

Without busy pin display.refresh() does not do anything.

makermelissa commented 1 year ago

I'm using an e-ink display that is supported by this library.

Which specific display are you using? Also which version of CircuitPython? I tested out a number of different featherwing displays over the past few days using CP 8.2.6 and had no issues.

Also, did you set both of the lines with # Set to None for FeatherWing next to them to None?