russhughes / st7789_mpy

Fast MicroPython driver for ST7789 display module written in C
Other
553 stars 110 forks source link

TFT 240x240 : OK with Arduino lib with 4 wires , KO with st7789_mpy #28

Closed picpic020960 closed 3 years ago

picpic020960 commented 3 years ago

Bonjour Russ , have a TFT 240x240 , 7 pins connect to ESP32 with 4 wires : SCL : 18 SDA : 23 RES : 4 DC : 2 arduino lib Bodmer/TFT_eSPI-2.3.59.zip , example program : work fine.

then load micropython with st7789 c driver (.bin T-DISPLAY feb) , transpose the pins in the hello.py , run ... and nothing on the screen.

How can i debug ? Thanks for help

ref of tft : https://fr.aliexpress.com/item/32867668144.html?src=google&albch=shopping&acnt=248-630-5778&isdl=y&slnk=&plac=&mtctp=&albbt=Google_7_shopping&aff_platform=google&aff_short_key=UneMJZVf&&albagn=888888&isSmbAutoCall=false&needSmbHouyi=false&albcp=11565796786&albag=115683794594&trgt=800756788306&crea=fr32867668144&netw=u&device=c&albpg=800756788306&albpd=fr32867668144&gclid=CjwKCAjw6fCCBhBNEiwAem5SOwd2Ica_p6Ho7MJlXCONTVeBv506hjq8TLdQg-WhAllQDso7NmHGhBoCQ1oQAvD_BwE&gclsrc=aw.ds

robhamerling commented 3 years ago

I have a similar display (but 8 pins), it works fine with ESP32 and Micropython (latest firmware).

spi = SPI(2, baudrate=30000000, polarity=1, phase=1, sck=Pin(18), mosi=Pin(23))
tft = st7789.ST7789(spi, 240, 240,
                     reset=Pin(22, Pin.OUT),
                     cs=Pin(5, Pin.OUT),
                     dc=Pin(21, Pin.OUT),
                     backlight=Pin(4, Pin.OUT),
                     rotation=0)            

Remark: I find it somewhat confusing that the board uses PIN names SCL and SDA. These terms are normally used with I2C, while the ST7789 uses SPI protocol and SCK and SDI/MOSI would be appropriate.

picpic020960 commented 3 years ago

Hello robhamerling works fine with your parameters thanks a lot