Replies: 6 comments 21 replies
-
|
ok the spi3wire is s very unique animal and how to use it greatly depends on how the pins are wired for both the display and the SPI3 wire. What the SPI3 wire does it is for the purpose of sending the initialization commands to the RGB to MIPI bridge IC that your display has. I have not coded in any bridge IC drivers so it would be up to you to do that portion of the work. I would have to take a look at the display IC you are using to see if the bridge IC is built into that or if it is a separate standalone IC. A lot of times it is a standalone IC. If you have access to arduino code for running the display I can use that to see what is going on and I can then provide you with better instruction and examples to use.. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for response, for the code I just edited some demo stuff that was provided by Waveshare. And here is esp_lcd_st7701_mipi file Init for spi3wire has the same values you setup for ST7701 type 12 driver, so more or less I just think that I'm doing something wrong with tools that you provided, PS. I'm very sorry for bunch of edits but those files don't agree with code blocks. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, Kindest Regards |
Beta Was this translation helpful? Give feedback.
-
|
Think i have a similar constrution area with #541 to get the 4 Inch 480x480 RGB Display running on the SQUiXL device by "Unexpected Maker". It's a ST7701S and @kdschlosser mendiond that it should run with https://github.com/lvgl-micropython/lvgl_micropython/blob/main/api_drivers/common_api_drivers/display/st7701/st7701.py ... But it's needed a Spi3Wire instance. And i found the implementation here: https://github.com/lvgl-micropython/lvgl_micropython/blob/main/api_drivers/common_api_drivers/frozen/other/spi3wire.py but there is the comment in there:
What does really mean?!? |
Beta Was this translation helpful? Give feedback.
-
|
Not sure i still can make this work. For now I setup this type for my screen using configuration found in files that I got form arduino demo. but even with that there is no response from the screen, interesting enough I was able to find driver implementation that works with framebuf library, so I'm even more lost. Kindest Regards |
Beta Was this translation helpful? Give feedback.
-
|
OK so here we go... I found several issues in your startup code. You had the SPI3Wire incorrectly setup . you were initializing the spi3wire when you shouldn't have been. The biggest one is you had the reset state for the display set so it was always going to be resetting. This display IC uses a negative to activate the reset not a positive so I had to add the parameter to flip that state. Give this a go and see if it works for ya. from micropython import const
_H_RES = const(320)
_V_RES = const(820)
# Wiring diagram says pin 42 so if it doesn't work then try changing the 0 to 42
_LCD_CS = const(0)
_LCD_SDA = const(1)
_LCD_SCL = const(2)
_3WIRE_FREQ = const(500000)
_LCD_FREQ = const(12000000)
_BL = const(6)
_H_PULSE = const(6)
_V_PULSE = const(40)
_H_FRONT = const(30)
_H_BACK = const(30)
_V_FRONT = const(20)
_V_BACK = const(20)
_DE = const(40)
_PCLK = const(41)
_VSYNC = const(39)
_HSYNC = const(38)
_RESET = const(16)
_R0 = const(17)
_R1 = const(46)
_R2 = const(3)
_R3 = const(8)
_R4 = const(18)
_G0 = const(14)
_G1 = const(13)
_G2 = const(12)
_G3 = const(11)
_G4 = const(10)
_G5 = const(9)
_B0 = const(21)
_B1 = const(5)
_B2 = const(45)
_B3 = const(48)
_B4 = const(47)
import spi3wire
spi3wire_bus = spi3wire.Spi3Wire(
sda=_LCD_SDA,
scl=_LCD_SCL,
cs=_LCD_CS,
freq=_3WIRE_FREQ,
spi_mode=1, # This is supposed to be a 1
use_dc_bit=True,
cs_high_active=False, # This should be False
dc_zero_on_data=False, # This should be False
del_keep_cs_inactive=True
)
import lcd_bus
display_bus = lcd_bus.RGBBus(
hsync=_HSYNC,
vsync=_VSYNC,
de=_DE,
pclk=_PCLK,
data0=_B0, data1=_B1, data2=_B2, data3=_B3, data4=_B4,
data5=_G0, data6=_G1, data7=_G2, data8=_G3, data9=_G4, data10=_G5,
data11=_R0, data12=_R1, data13=_R2, data14=_R3, data15=_R4,
freq=_LCD_FREQ,
hsync_pulse_width=_H_PULSE,
hsync_back_porch=_H_BACK,
hsync_front_porch=_H_FRONT,
vsync_pulse_width=_V_PULSE,
vsync_back_porch=_V_BACK,
vsync_front_porch=_V_FRONT,
)
import st7701
import lvgl as lv # NOQA
display = st7701.ST7701(
data_bus=display_bus,
spi_3wire=spi3wire_bus,
display_width=_H_RES,
display_height=_V_RES,
backlight_pin=_BL,
backlight_on_state=st7701.STATE_PWM,
reset_pin=_RESET,
reset_state=st7701.STATE_LOW,
color_space=lv.COLOR_FORMAT.RGB565,
bus_shared_pins=False
)
display.set_power(True)
# I am not sure what type you said was the closest. I thought it was 12 but in your code 18 is being used.
# Change this as needed or I can also do up a custom init if needed.
display.init(type=18)
display.set_backlight(100)
display.set_rotation(270)
import task_handler
th = task_handler.TaskHandler()
scrn = lv.screen_active()
scrn.set_style_bg_color(lv.color_hex(0xFF0000), 0)
label = lv.label(scrn)
label.set_text('HELLO WORLD!')
label.align(lv.ALIGN.CENTER, 0, 0)
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hello gents,
At start I will just mention that whole reason that I ended up here was my aversion to spend 120-140$ for screen kit for my new pc case. So after week or so of research focusing on finding screen that will fit into it (for curious people my case is termaltake tr100, and in my country price is higher than on amazon) I found this. ESP32-S3 3.16 LCD 320x820. Sadly on their site they do not provide official documentation how to setup this device in micropython. After getting familiar what libraries are used to display cool stuff and playing with Arduino IDE, I decided to google if lvgl is ported to micropython and that's how I found this amazing piece of software.
I compiled binary the way that readme dictates choosing ST7701 library, after looking over codebase I see there are 16 types that you can use, and how happy I was that there is type 12 that is setup for this board. But now I'm confused, I understand that this specific board has RGB display bus, but you also require spi3wire to initialize this. At this point I'm not sure what I'm doing wrong, backlight works, but screen is dead. Display is setup correctly, I'm not sure about spi3wire or how this should be initialized properly. Over last 3 days I read through most of this project discussions and issues, and looking how some of them were started quite some time ago. I'm not sure if provided solutions were implemented or driver was adjusted to reflect those changes, 9bit_soft_spi would be great example. So now I would like some help to understand how I should properly initialize spi3wire for this ST7701 driver.
Kindest Regards
Beta Was this translation helpful? Give feedback.
All reactions