nopnop2002 / esp-idf-st7789

ST7789 Driver for esp-idf
MIT License
234 stars 56 forks source link

Blank Display #10

Closed DiegoPaezA closed 4 years ago

DiegoPaezA commented 4 years ago

Hi, I'm trying to use the library but I can't make it work. I already did the configuration as you show in the pictures, the program compile and runs well but never shows anything on the display. I also test the display with and Arduino library and works perfect. Could you give some idea to make it work? Thanks. Captura

nopnop2002 commented 4 years ago

Hello. As far as I know, ST7789 needs BackLight.

It's mine:

I (466) ST7789: GPIO_CS=-1
I (466) ST7789: GPIO_DC=12
I (466) ST7789: GPIO_RESET=13
I (616) ST7789: GPIO_BL=32
I (616) ST7789: GPIO_MOSI=23
I (616) ST7789: GPIO_SCLK=18
I (2906) FillTest: elapsed time[ms]:1590
I (6956) ColorBarTest: elapsed time[ms]:50
DiegoPaezA commented 4 years ago

Hi,

I try it, but nothing change. Thanks for your help.

nopnop2002 commented 4 years ago

Hello.

I want to see a picture of your TFT.

DiegoPaezA commented 4 years ago

Hi,

I tested the display with tft_espi library (https://github.com/Bodmer/TFT_eSPI) with Arduino using the same connections (without the BLK pin) and works perfect.

Thanks for your help.

IMG_20200405_085955 IMG_20200405_085842

nopnop2002 commented 4 years ago

Both the board and the TFT are the same as mine.

Even in my environment, it worked without connecting BLK anywhere.

DiegoPaezA commented 4 years ago

I already did both test, connecting BLk to 3.3v and ground the only change is the display turning on and off.

Captura

nopnop2002 commented 4 years ago

It's mine.

The CPU frequency is different for some reason.

freeRTOS version:V8.2.0
NEWLIB version:3.0.0
lwIP version:2-1-3-0
ESP-IDF version:v4.2-dev-701-g0ae960f2f-dirty
ets_get_cpu_frequency:240

My sdkconfig

CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
DiegoPaezA commented 4 years ago

I'm going try updating the idf.

Captura

nopnop2002 commented 4 years ago

After ESP-IDF Ver4.1, it is necessary to change the tool chain from xtensa-esp32-elf-esp-2019r1 to xtensa-esp32-elf-esp-2019r2.

$ xtensa-esp32-elf-gcc --version
xtensa-esp32-elf-gcc (crosstool-NG esp-2019r2) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
DiegoPaezA commented 4 years ago

After update idf to 4.2, I test the display software and all the examples works as must be, but, then i try with a simple blink led and after that try again the display software, nothing happen. I really don't understand what is the problem, I clean the project, build all again, and nothing. Captura

nopnop2002 commented 4 years ago

Please change the SPI frequency and try.

//static const int SPI_Frequency = SPI_MASTER_FREQ_20M;
//static const int SPI_Frequency = SPI_MASTER_FREQ_26M;
static const int SPI_Frequency = SPI_MASTER_FREQ_40M;
//static const int SPI_Frequency = SPI_MASTER_FREQ_80M;

SPI_FREQUENCY of tft_espi library (https://github.com/Bodmer/TFT_eSPI) is 20MHz.

// If the SPI frequency is not defined, set a default
#ifndef SPI_FREQUENCY
  #define SPI_FREQUENCY  20000000
#endif

Is there any external device connected to ESP32 TFT other than TFT? ?

DiegoPaezA commented 4 years ago

Thanks for your Help, finally works. I change the frequency as you said.

display

nopnop2002 commented 4 years ago

I am glad to hear your report.

In the next release, I will change the default CPU frequency to 20Mhz.