Bodmer / TFT_eSPI

Arduino and PlatformIO IDE compatible TFT library optimised for the Raspberry Pi Pico (RP2040), STM32, ESP8266 and ESP32 that supports different driver chips
Other
3.79k stars 1.09k forks source link

Can't change SPI DC or RST GPIO designations #2047

Closed Bwanna closed 2 years ago

Bwanna commented 2 years ago

(Trying to follow the template. Please let me know if I missed anything.)

  1. ISSUE DESCRIPTION:
    • GPIO designations for DC and RST can not be changed. (using "Read_User_Setup" DC always stays GPIO 0. RST always stays GPIO 2. Regardless of placing #define statements in sketch or User_Setup.h
  2. IDE Arduino v2.0.0
  3. TFT_eSPI library version 2.4.76
  4. Board package version (don't know how to find this info - get from espressif)
  5. ESP32 DevKitC
  6. TFT driver ST7789
  7. Interface type SPI

User_Setup.h

// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP32 SETUP   ######

// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins

#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS   15   
#define TFT_DC    2     <<<<<
#define TFT_RST   4     <<<<<

Read_User_Setup.h OUTPUT

TFT_eSPI ver = 2.4.72
Processor    = ESP32
Frequency    = 240MHz
Transactions = Yes
Interface    = SPI
Display driver = 7789
Display width  = 240
Display height = 320

MOSI    = GPIO 23
MISO    = GPIO 19
SCK     = GPIO 18
TFT_CS   = GPIO 15
TFT_DC   = GPIO 0     <<<<<
TFT_RST  = GPIO 2     <<<<<

Font GLCD   loaded
Font 2      loaded
Font 4      loaded
Font 6      loaded
Font 7      loaded
Font 8      loaded
Smooth font enabled

Display SPI frequency = 27.00

NOTE Display works correctly same pin assignments with https://github.com/adafruit/Adafruit-ST7735-Library.

Bodmer commented 2 years ago

Check DC and RST pins are not being defined elsewhere and that the correct setup file is being included.

Bwanna commented 2 years ago

Here's what I've done, still not working:

Have tested with a few different ESP dev modules - no luck.
Again - hardware works fine using any other ST7789 library with the same configurations. Need to get TFT_eSPI working so it will interface with GUISlice software.

ANY ideas would be appreciated.

Bwanna commented 2 years ago

RESOLVED

Had to insert into Setup18_ST7789.h the pin defines from the User_Setup.h file. Don't understand why the same pin defines wouldn't work when placed in the Sketch or the User_Setup.h file?

Bodmer commented 2 years ago

It sounds like 2 setup files are being called up. The User_Setup_Select.h file should only have one line uncommented.