tft_config.py : wrong PIN assignment?
fundef1 opened this issue · 8 comments
Hi,
i'm having trouble getting the display to work, and while double checking I found the following:
on the schematic and in other bits of code, LEDA (backlight?) is assigned to pin 38
#define TFT_LEDA_PIN 38
in python it is PIN 37
backlight=Pin(37, Pin.OUT),
setting backlight to pin38 seems to make tft.on() and tft.off() work, albeit reversed... it's active low i.e. tft.on() switches the backlight off.
Just starting with this dongle myself, but if in micropython I do:
import machine
backlight = machine.Pin(38, machine.Pin.OUT)
backlight.off()
That does turn on the backlight. Reverse logic though as you say. It appears to be set to pin 37 in tft_config.py though as well.
I have the feather.py example working OK, I just don't see any of the examples that use text yet.
Also, I found that the fonts are not loaded in the firmware, you have to get them from somewhere else - e.g. the hello.py example works if I upload https://github.com/VynDragon/WPOS/blob/master/vga1_bold_16x32.py to the board first.
@Xendi, did you get the display to work? I am starting to think mine was DOA.
Can you run hello.py with the font uploaded? If not then yeah it might be.
If you use the mpy firmware provided by lilygo, it already contains the modified st7735 driver. Fonts can be read by dragging and dropping them into the file system.
If you use the mpy firmware provided by lilygo, it already contains the modified st7735 driver. Fonts can be read by dragging and dropping them into the file system.
which 'mpy' firmware are you referring to? I flashed to .bin from here
https://github.com/Xinyuan-LilyGO/T-Dongle-S3/tree/main/example/Micropython/firmware
which contains the tft_config.py with the wrong PIN assignment for the backlight.
(also: what do you use to drag & drop , i'm copying files across with mpremote - which is a bit tedious)
The control of the backlight is to light the backlight at a low level. Maybe the pins for the backlight in tft_config.py are set wrong, but it still works as a config tft. After the burning is completed, drag this routine into the directory through the thonny software and run it normally.
https://github.com/mmMicky/st7735_mpy/blob/798700a5feba063171a6acdc2729ba1e63cfb861/examples/bitarray.py
Problem seems to be resolved. I will close this issue