Closed karstengit closed 2 years ago
Sorry for opening as bug report - I did not see that there is an active discussion forum. https://github.com/Bodmer/TFT_eSPI/discussions/2146
I suspect this is a pin mapping problem. The library was originally developed soley for the ESP8266 NodeMCU board and thus the default pin definitions are for that particular boaard.
Unfortunately different board suppliers map different "Dxx" pins to different GPIO, so in your instance it would be best to use direct GPIO numbers.
Just for information only, this is the mapping from PIN_Dxx definitions to GPIO for the default:
// These are the pins for ESP8266 boards
// Name GPIO NodeMCU Function
#define PIN_D0 16 // GPIO16 WAKE
#define PIN_D1 5 // GPIO5 User purpose
#define PIN_D2 4 // GPIO4 User purpose
#define PIN_D3 0 // GPIO0 Low on boot means enter FLASH mode
#define PIN_D4 2 // GPIO2 TXD1 (must be high on boot to go to UART0 FLASH mode)
#define PIN_D5 14 // GPIO14 HSCLK
#define PIN_D6 12 // GPIO12 HMISO
#define PIN_D7 13 // GPIO13 HMOSI RXD2
#define PIN_D8 15 // GPIO15 HCS TXD0 (must be low on boot to enter UART0 FLASH mode)
#define PIN_D9 3 // RXD0
#define PIN_D10 1 // TXD0
#define PIN_MOSI 8 // SD1 FLASH and overlap mode
#define PIN_MISO 7 // SD0
#define PIN_SCLK 6 // CLK
#define PIN_HWCS 0 // D3
#define PIN_D11 9 // SD2
#define PIN_D12 10 // SD4
I think these settings may be suitable for your board if it is wired like this. Note that the SPI ports are mapped to specific GPIO pins on the ESP8266 and thus MISO, MOSI and SCLK must use those pins:
#define TFT_MISO 12
#define TFT_MOSI 13
#define TFT_SCLK 14
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 0 // Data Command control pin
#define TFT_RST 2 // Reset pin (could connect to RST pin)
Note also that some pins must be at a certain level at boot time for the processor to startup and run the sketch (see comments above). Typically ready built boards bias these pins into the correct state.
Run the Test and diagnostic example "Read_User_Setup" and look at the serial monitor output to check the compiler is picking up the settings correctly. Post the output here with a copy of your setup file if you are not sure the output is correct.
I already used this wonderful library successful with an STM32 Blue-Pill. Now i am trying to connect this display to an ESP8266-12F with an own small adapter PCB.
I am using again the benchmark test that can be found in the examples.
with this User_Setup.h in the same folder
It compiles, can be flashed and the UART is working, but there cannot be seen any signal on the connected lines with an oscilloscope on SCK and MOSI, the CS TFT is always Low.
What i am doing wrong?