Loboris TFT module issue report

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
cable134
Posts: 28
Joined: Sun Aug 20, 2017 10:51 pm

Loboris TFT module issue report

Post by cable134 » Sat Oct 07, 2017 9:50 pm

Hi all,

I just tried to use the latest Loboris firmware with SPI TFT 160x128 module (ST7735R).

First of all I've tested my FTF module with Adafruit's Micropython TFT library.

Code: Select all

import st7735
from machine import SPI, Pin
spi = SPI(1, baudrate=10000000, mosi=13, miso=12, sck=14, cs=15)

display = st7735.ST7735R(spi, cs=Pin(15), dc=Pin(27), rst=Pin(26), width=128, height=160)
display.fill(st7735.color565(0xff,0xff, 0xff))
display.fill_rectangle(0,0,20,20, st7735.color565(0xff,0x11, 0x22)) # draws a rectangle
It works fine. Please see corresponding photo and screenshot from Logic.


Than i tried to use code from the Loboris firmware with the same hardware setup.
It's listed below.

Code: Select all

import time
import display
tft = display.TFT()

tft.init(tft.ST7735R, speed=10000000, spihost=tft.HSPI, mosi=13, miso=12, clk=14, cs=15, dc=27, rst_pin=26, hastouch=False, bgr=False, width=128, height=160)

tft.clear()
for i in range(9):
    tft.pixel(i,i,128)
If you check attached Logic screen you will notice that CS line is in Upper state all the time.
Thus I got a fail.

Hope my report will be useful.
If you need another test or additional details please feel free to ask.
Attachments
Adafruit_IMG.jpg
Adfruit ESP32 TFT 160x128 Display setup
Adafruit_IMG.jpg (139.62 KiB) Viewed 3287 times
LoborisLogic.png
Loboris TFT library logged data
LoborisLogic.png (112.84 KiB) Viewed 3287 times
AdafruitLogic.png
Adafruit TFT library logged data
AdafruitLogic.png (150.75 KiB) Viewed 3287 times

loboris
Posts: 344
Joined: Fri Oct 02, 2015 6:19 pm

Re: Loboris TFT module issue report

Post by loboris » Sun Oct 08, 2017 10:09 am

There were some bugs in the display driver which prevented usage of some pins as display CS and DC.
For example GPIO15 is on boot routed to the JTAG interface, and was not released before using it as display CS.
There was also a problem with using pins >= 32 for interfacing the display.

The bugs are fixed now, and the display module should work as expected.

Tested with Adafruit TFT FeatherWing, which couldn't function because of the mentioned bugs.

@cable134
Tested with

Code: Select all

tft.init(tft.ST7735R, speed=10000000, spihost=tft.HSPI, mosi=13, miso=12, clk=14, cs=15, dc=27, rst_pin=26, hastouch=False, bgr=False, width=128, height=160)
(the same display module as on your picture) and it works now.
Note: spihost=tft.HSPI, hastouch=False, bgr=False are defaults and can be omitted from init.

Some display examples are available in:
MicroPython_ESP32_psRAM_LoBo/MicroPython_BUILD/components/micropython/esp32/modules_examples/tft/tftdemo.py

Post Reply