Open lfg6000 opened 12 months ago
The driver is based on that for the 320x240 ILI9488 display. The unit sequence was pulled from TFT_eSPI’s Arduino driver. It was tested on circuitpython 8 with the following example:
import board, busio, ili9488
spi = busio.SPI(board.D2,board.D3,board.D4)
tft_dc = board.D0
tft_cs = board.D1
display_bus = displayio.FourWire(
spi, command=tft_dc, chip_select=tft_cs, reset=board.D5
)
display = ili9488.ILI9488(display_bus, width=320, height=240)
for larger versions, I believe a different initialization sequence would be needed but I will look into it.
thanks for the quick response.
it was clever of you to port the TFT_eSPI init seq to adarafruit circuit python.
currently have an arduino project using TFT_eSPI to drive a ili9488 (480x320) display and it works fine.
so the TFT_eSPI ili9488 init seq works fine for arduino code
the current project is trying to combine a ili9488 480x320, Raspberry Pi 4B and adafruit-circuitpython
to eliminate the Index error i changed: b"\x36\48" to b"\x36\x48"
this fix allows the code to run but the display is not working...no color background or text appears (i am using the adafruit-circuitpython example code)
i can make a ili9341 320x240 work with a Raspberry Pi 4B and adafruit-circuitpython
i can make a HX8357D 480x320 work with a Raspberry Pi 4B and adafruit-circuitpython
sure would like to get a ili9488 480x320 to work with a Raspberry Pi 4B and adafruit-circuitpython
Which raspberry pi are you using?
I just wanted to let you know I’m working on some changes that I’ll push up maybe tonight or tomorrow. I’ll let you know so you can try it out. Thanks for helping out on this :)
Hey, I added another file to the repo specifically for the 320x480 displays:
https://github.com/skerr92/ILI9488_CiruitPython/blob/main/ili9488_480x320.py
Try it using a basic init and let me know how it goes.
import board, busio, ili9488_480x320
spi = busio.SPI(board.D2,board.D3,board.D4)
tft_dc = board.D0
tft_cs = board.D1
display_bus = displayio.FourWire(
spi, command=tft_dc, chip_select=tft_cs, reset=board.D5
)
display = ili9488_480x320.ILI9488(display_bus, width=320, height=480)```
Hi Seth,
first of all thanks for working on this.
took ili9488_480x320.py for a spin and it did not work for me.
i tried all 3 displays today: ili9341 320x240 and it works fine hx8357 480x320 and it works fine ili9488 480x320 and it does not work
Thanks, Louie
I’m still working to figure the issues out. I’m hoping to know soon though.
When I look at your INIT_SEQUENCE, you are missing the second (length) byte. First byte is command, second byte is the argument length followed by the argument-bytes.
When I look at your INIT_SEQUENCE, you are missing the second (length) byte. First byte is command, second byte is the argument length followed by the argument-bytes.
Would you mind putting up a PR to fix this?
If not, I can take care of it 🙂
I tried to change this, but it still does not work. I also tried various other ILI9488 init-sequences (from C, MicroPython, a second CircuitPython-ILI9488 driver and whatever else I found on the net), but no success so far.
@bablokb I saw your issue on Circuitpython and will be tracking closely the changes. I also looked over the data sheet and there is some inconsistencies with the init sequence that other drivers use compared to what the data sheet wants. I'll be pushing those changes up today in preparation for the circuitpython changes.
I have a working version here: https://github.com/bablokb/circuitpython-examples/blob/master/waveshare-3.5/ili9488_waveshare35.py
This is for the specific Waveshare hardware, but swapping in the _INIT_SEQUENCE
instead of the _INIT_SEQUENCE_16
in the constructor might also work on normal SPI-attached ILI9488 displays (with a standard 9.x.x-CircuitPython). Since I don't own the hardware, I cannot test it.
Thanks! I'll give it a go on the SPI display 👍🏻
hi, did anyone manage to get this going with a 480x320 screen? I'm using CircuitPython 9, with this library, but it doesn't work for me.
import board
import displayio
import terminalio
import ili9488
from adafruit_display_text.label import Label
from adafruit_display_shapes.triangle import Triangle
displayio.release_displays()
spi = board.SPI()
tft_cs = board.D41
tft_dc = board.D40
display_bus = displayio.FourWire(
spi, command=tft_dc, chip_select=tft_cs, reset=board.D42
)
display = ili9488.ILI9488(display_bus, width=480, height=320)
my_display_group = displayio.Group()
display.root_group = my_display_group
triangle = Triangle(170, 50, 120, 140, 210, 160, fill=0x00FF00, outline=0xFF00FF)
my_display_group.append(triangle)
my_label = Label(terminalio.FONT, text="My Label Text", color=0x00FF00)
my_display_group.append(my_label)
while True:
pass
hi, did anyone manage to get this going with a 480x320 screen? I'm using CircuitPython 9, with this library, but it doesn't work for me.
import board import displayio import terminalio import ili9488 from adafruit_display_text.label import Label from adafruit_display_shapes.triangle import Triangle displayio.release_displays() spi = board.SPI() tft_cs = board.D41 tft_dc = board.D40 display_bus = displayio.FourWire( spi, command=tft_dc, chip_select=tft_cs, reset=board.D42 ) display = ili9488.ILI9488(display_bus, width=480, height=320) my_display_group = displayio.Group() display.root_group = my_display_group triangle = Triangle(170, 50, 120, 140, 210, 160, fill=0x00FF00, outline=0xFF00FF) my_display_group.append(triangle) my_label = Label(terminalio.FONT, text="My Label Text", color=0x00FF00) my_display_group.append(my_label) while True: pass
Hi, so I have plans to get to this hopefully this weekend. I've been running around like a chicken with its head cut off and I haven't made it back yet.
It's on the docket though.
hi, did anyone manage to get this going with a 480x320 screen? I'm using CircuitPython 9, with this library, but it doesn't work for me.
What library exactly? Is "this library" my version I linked from above or the version here? Please also check your hardware. Is your display directly attached to SPI, or does it use serial to parallel shift ICs? In the latter case, you also need to build a special CircuitPython version to make it work.
@bablokb I've tried the waveshare one you've linked, but had no success... also tried the ones in this repo, specifically ili9488_480x320.py, which I was hoping I could get going, but after spending hours on this couldn't get anything to show up on the screen at all -- I'm very new to all this, and have no idea what I'm doing...
The screen I have is https://www.aliexpress.com/item/32954240862.html. With the ProS3 microcontroller by Unexpected Maker. I've connected the display directly to SPI on the microcontroller.
This seems to be a SPI connected display. When you tried my driver, did you replace _INIT_SEQUENCE_16
with _INIT_SEQUENCE
?
I'm fairly sure most SPI Connected versions of this display won't work without the patch you made for bus core. I think that an option needs to be added to bus core to allow people to enable clocking each byte.
I am not sure about that. Many displays just connect the MCU-SPI directly to the ILI9488 chip, so they operate in 8bit serial mode. The display linked above by @jerryau definitely does not use the 16bit parallelbus input to the ILI9488. Unless of course the images that aliexpress uses are not correct. You never know.
@jerryau : can you confirm that the back side of your display is identical to the images from your aliexpress-link?
@bablokb , yes, the back side is exactly as pictured in the aliexpress listing
I have the same display as linked above on aliexpress. One interesting finding is that it does not support 16 bits/pixel. In practice for me it refuses to initialize when 0x3a = 0x05
(16-bit). Is alive when 0x3a = 0x01 / 0x06
(3-bit / 18-bit).
I am getting some image from it, however pixel format is wrong. In 18-bit mode, using color_depth=24
fills display black, and using color_depth=16
there is text visible but clear that rows are not filled due to display expecting 3 bytes and us sending only 2.
For now I am not sure what to do since displayio.Display
does not expose much controls.
Basic working example:
class ILI9488(displayio.Display):
_INIT_SEQUENCE = (
b"\x3A\x01\x01" # pixel format
b"\x36\x01\x28" # rotation
b"\x11\x80\x78" # exit sleep
b"\x29\x80\x78" # display on
)
def __init__(self, bus: displayio.FourWire, **kwargs):
super().__init__(bus, self._INIT_SEQUENCE, **kwargs)
displayio.release_displays()
display_spi = busio.SPI(board.GP2, board.GP3, board.GP4)
bus = fourwire.FourWire(display_spi, command=board.GP6, chip_select=board.GP5, reset=board.GP7)
display = ILI9488(bus, width=480, height=320, rotation=180, color_depth=8)
display.root_group = displayio.CIRCUITPYTHON_TERMINAL
So the issue comes down to circuitpython not supporting RGB666. If your display was using parallel input, you wouldn't have issues. I'm working on bringing RGB666 support to circuitpython but the timeline on that is unclear. Maybe the next month or two based on how much time I can put into it.
If you have something to test, please let me know. There are other display chips that support RGB666, so testing it would be possible even without that specific display.
display = ili9488.ILI9488(display_bus, width=480, height=320)
getting a IndexError: index out of range on this line when i=48 in Display _initialize(self, init_sequence): delay_time_ms = init_sequence[i + 1 + data_size]
fyi ... i have sucessfully used this same code using a smaller display display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
these are the libraries that are installed on my raspberry pi Adafruit-Blinka | 8.20.0 | 8.20.0 Adafruit-PlatformDetect | 3.47.0 | 3.47.0 Adafruit-PureIO | 1.1.11 | 1.1.11 Pillow | 9.5.0 | 10.0.0 RPi.GPIO | 0.7.1 | 0.7.1 adafruit-blinka-displayio | 0.10.4 | 0.10.4 adafruit-blinka-pyportal | 2.0.1 | 2.0.1 adafruit-circuitpython-adafruitio | 5.7.1 | 5.7.1 adafruit-circuitpython-bitmap-font | 2.0.1 | 2.0.1 adafruit-circuitpython-busdevice | 5.2.6 | 5.2.6 adafruit-circuitpython-display-text | 2.28.3 | 2.28.3 adafruit-circuitpython-fakerequests | 1.0.12 | 1.0.12 adafruit-circuitpython-focaltouch | 1.4.8 | 1.4.8 adafruit-circuitpython-hx8357 | 1.3.10 | 1.3.10 adafruit-circuitpython-ili9341 | 1.3.10 | 1.3.10 adafruit-circuitpython-minimqtt | 7.4.0 | 7.4.0 adafruit-circuitpython-miniqr | 2.0.1 | 2.0.1 adafruit-circuitpython-neopixel | 6.3.9 | 6.3.9 adafruit-circuitpython-pixelbuf | 2.0.2 | 2.0.2 adafruit-circuitpython-portalbase | 1.14.8 | 1.14.8 adafruit-circuitpython-requests | 2.0.0 | 2.0.0 adafruit-circuitpython-simpleio | 3.0.11 | 3.0.11 adafruit-circuitpython-stmpe610 | 1.3.11 | 1.3.11 adafruit-circuitpython-typing | 1.9.4 | 1.9.4
Questions
it would be very very nice to get this to work so any thoughts you can send may way would be really helpful