Solved: Using TFT_eSPI with an ESP8266 #2147
-
I already used this wonderful library successful with an STM32 Blue-Pill. 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? |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 11 replies
-
Sorry for opening as bug report - I did not see that there is an active discussion forum. |
Beta Was this translation helpful? Give feedback.
-
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:
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:
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. |
Beta Was this translation helpful? Give feedback.
-
I have converted this to a discussion topic. |
Beta Was this translation helpful? Give feedback.
-
The pins assignment is double checked and correct to your assignment
There is only this one additional SPI-Port and the one that can be shared with the Flash-Chip. |
Beta Was this translation helpful? Give feedback.
-
GPIO13 is used for MOSI. There can only be found the correct User_Setup.h in /tmp/arduino_build_381780/sketch and no "Read_User_Setup" ? |
Beta Was this translation helpful? Give feedback.
-
I assume there is another fundamental problem. Everything works fine with this settings for other sketches using SPI. |
Beta Was this translation helpful? Give feedback.
-
The Read_User_Setup sketch is an example here: |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay. First I did have to find out that the ESP8266 somehow did not work correctly - so I changed it to another new one. Now
but no working display. I can see signals on MOSI, SCK and CS TST now, but no signal on DC. |
Beta Was this translation helpful? Give feedback.
-
Is a local User_Setup.h in the folder of the *.ino ignored? |
Beta Was this translation helpful? Give feedback.
-
I suggest to wire the led-blacklight to 3,3v,here my setup working: //----------------------------------------------------------- #define ILI9341_DRIVER //MOSI>D7,SCK>D5, MISO> better (on the air) #define TFT_CS PIN_D0 // SS/RS - Chip select control pin D8 //#define TOUCH_CS PIN_D3 // Chip select pin (T_CS) of touch screen #define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH #define SMOOTH_FONT #define SPI_FREQUENCY 20000000 #define SPI_READ_FREQUENCY 20000000 #define SPI_TOUCH_FREQUENCY 2500000 |
Beta Was this translation helpful? Give feedback.
-
LED-Backlight and Reset was already fixed to 3V3. Now I tried exact your configuration (copyCATandpasteDOG) and it really works! But why it does not work with
? |
Beta Was this translation helpful? Give feedback.
-
It's a mistery,i had to search all over the net to discover this by hazard this setup,there is no reason for me why it's not working either, |
Beta Was this translation helpful? Give feedback.
-
Thanks for confirming this "bug". I have no idea how the pin mapping is done? Here in the library the NodeMCU pins are used, but normally the Arduino pin numbers can be used. |
Beta Was this translation helpful? Give feedback.
-
Hey karstengit,my setup i gave you works also for touch,just uncomment: |
Beta Was this translation helpful? Give feedback.
I suggest to wire the led-blacklight to 3,3v,here my setup working:
//-----------------------------------------------------------
#define ILI9341_DRIVER
//MOSI>D7,SCK>D5, MISO> better (on the air)
#define TFT_CS PIN_D0 // SS/RS - Chip select control pin D8
#define TFT_DC PIN_D8 // Data Command control pin
#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
//#define TOUCH_CS PIN_D3 // Chip select pin (T_CS) of touch screen
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 …