ESP8266 with ST7796S 4.0inch TFT SPI

Hello,

I want to use 4.0inch TFT SPI display with Wemos D1 (ESP8266)
I download TFT_eSPI library.
When i upload graphic example with choosen ILI9341 display works with 2/3 of screen (1/3 screen is white)
With setup ST7796 i have just white screen,

graphictest.ino

#define TFT_DC D3
#define TFT_CS D8

User_Setup.h

#define ST7796_DRIVER

User_Setup_Select.h

#include <User_Setups/Setup28_RPi_ST7796_ESP8266.h>

Setup36_RPi_touch_ST7796.h

//#define RPI_DISPLAY_TYPE
#define ST7796_DRIVER // 20MHz maximum SPI

#define TFT_MISO D6
#define TFT_MOSI D7
#define TFT_SCLK D5
#define TFT_CS D8 // Chip select control pin
#define TFT_DC D3 // Data Command control pin
#define TFT_RST D4 // Reset pin (could connect to RST pin)

#define SPI_FREQUENCY 27000000

I also test display with Adafruit ILI9341 and display works with 2/3 of screen (1/3 screen is white)

Any sugestions ?

Go on. Post a link to the actual screen that you bought. Post a link to the actual ESP8266 board that you bought.

I always advise connecting TFT_RST pin. In other words, follow the wiring in the User_Setup.

David.

I change i user_setup

//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V

I change connection from wemos pinD4 to reset with no result :frowning:

You have a Red SPI display. There is no Touch Controller.

I strongly advise you to start with User_Setups/Setup28_RPi_ST7796_ESP8266.h comment the #define RPI_DISPLAY_TYPE and save as your custom Setup with a descriptive name e.g. SetupNN_ST7796_ESP8266.h

Wire screen to the ESP8266 D1 board according to the defines.

Select "Wemos D1 R1" board in the IDE.

David.

I almost give up. Still not working, maybe i messed up with this config files…

Setup28_RPi_ST7796_ESP8266.h (4.71 KB)

User_Setup.h (15.1 KB)

User_Setup_Select.h (10.3 KB)

User_Setup_Select.h

// Only ONE line below should be uncommented.  Add extra lines and files as needed.

//#include <User_Setup.h>           // Default setup is root library folder
...
#include <User_Setups/Setup28_RPi_ST7796_ESP8266.h>  // ESP8266 RPi MHS-4.0 inch Display-B
...

Bodmer provides lots of ready-made Setups. You must follow his instructions. e.g. Only ONE line below should be uncommented.

David.

I reinstall library.

User_Setup_Select.h

//#include <User_Setup.h>
#include <User_Setups/Setup28_RPi_ST7796_ESP8266.h>

Setup28_RPi_ST7796_ESP8266.h

//#define RPI_DISPLAY_TYPE
#define TFT_CS PIN_D2 // Chip select control pin D2
#define TFT_DC PIN_D3 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
#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_D1 // Chip select pin (T_CS) of touch screen
#define SPI_FREQUENCY 27000000
#define SUPPORT_TRANSACTIONS

Connection:

WemosD1 TFT
D2 → CS
D3/SCL/D15 → DC/RS
D5/SCK/D13 → SCK
D6/MISO/D12 → SDO(MISO)
D7/MOSI/D11 -->SDI(MOSI)
RESET → RESET

Still white screen

TFT_eSPI ver = 2.3.4
Processor    = ESP8266
Frequency    = 80MHz
Voltage      = 3.22V
Transactions = Yes
Interface    = SPI
SPI overlap  = No

Display driver = 7796
Display width  = 320
Display height = 480

TFT_CS   = PIN_D2
TFT_DC   = PIN_D3

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

If you follow my advice, I will continue.

If you don't, I will give up. I waste too much time replying to posters that choose to ignore advice.

David.

User_Setup_Select.h

//#include <User_Setup.h>
#include <User_Setups/SetupNN_ST7796_ESP8266.h>

SetupNN_ST7796_ESP8266.h
//#define RPI_DISPLAY_TYPE
#define TFT_CS PIN_D2 // Chip select control pin D2
#define TFT_DC PIN_D3 // Data Command control pin
#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#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_D1 // Chip select pin (T_CS) of touch screen
#define SPI_FREQUENCY 27000000
#define SUPPORT_TRANSACTIONS

WemosD1 TFT
D2 → CS
D3/SCL/D15 → DC/RS
D4/SDA/14 → RESET
D5/SCK/D13 → SCK
D6/MISO/D12 → SDO(MISO)
D7/MOSI/D11 -->SDI(MOSI)

I would expect everything to work now.

I have a D1 R1 board and a Red SPI with ST7796. I select "Wemos R1 D1" board in IDE.

Ok, I use different wiring (because my Adapter works on other Arduino boards):

#define TFT_MOSI D11
#define TFT_MISO D12
#define TFT_SCK  D13
#define TFT_CS   D10  // Chip select control pin D8
#define TFT_DC   D9  // Data Command control pin
#define TFT_RST  D8  // Reset pin (could connect to NodeMCU RST, see next line)
#define TOUCH_CS D3  // Chip select pin (T_CS) of touch screen

But your wiring should work 100% too.

David.

I have selected Wemos R1 D1

i have also shield made by my own very long time ago and some chinese stand for esp
i’ll try to run it on them

Now its working, it must be something with Wemos.

THX for help.

There are different adress of pins in wemos
After change pins TFT works on wemos too