3.95 tft ST7796S white screen

Hi! I have bought the following display :

I’ve tried many libraries:

But I allways have issues when compiling in ARDUINO IDE.

Anyone can help ?

Regards,

Your link shows a Red pcb configurable for 16Bit / 8Bit. Default is 8-Bit.

Install MCUFRIEND_kbv v2.9.9-Release via IDE Library Manager

8-Bit:
define USE_SPECIAL, USE_MEGA_8BIT_PORTC_SHIELD as described in mcufriend_how_to.txt

I strongly advise you to configure for 16-Bit. After all, you have a Mega2560 with plenty of header pins / sockets.

16-Bit:
define USE_SPECIAL, USE_MEGA_16BIT_SHIELD as described in mcufriend_how_to.txt

These displays are write-only.

     uint16_t ID = tft.readID();
     if (ID == 0xD3D3) ID = 0x7796;
     tft.begin(ID);

David.

Good day David,

thank you for your involvement.

My screen : https://www.aliexpress.com/item/4000570757588.html?spm=a2g0s.9042311.0.0.27424c4dU6HnWG
My arduino MEGA :
Mega 2560 R3 Starter Kit Motor Servo Rfid Ultrasonic Ranging Relay Lcd For Arduino - Integrated Circuits - AliExpress

I have erased all the libraries in « Documents/Arduino/Libraries », then all the folder « Arduino15 » in User/AppData, and uninstalled Arduino IDE.
I have then installed last Arduino IDE 1.8.13 on Windows 10
Then I downloaded :

  • MCUFRIEND_kbv-2.9.9-Release
  • Adafruit-GFX-Library-master
    I then opened Arduino.exe, to install those two libraries

Image1
Image2

I modified the following lines in the programs :

  • Edit mcufriend_shield.h: #define USE_SPECIAL
  • Edit mcufriend_special.h: #define USE_MEGA_8BIT_PORTC_SHIELD
    I then ran the LCD_ID_Reader.ino program

Image3

Isn’t it strange it says version 2.9.8 even if the 2.9.9 is installed ?
Here are my settings for the Arduino MEGA :

Image4

I modified the graphictest_kbv.ino program : (7796)

Image5

When I compile the graphictest_kbv.ino program, I have the following errors :
In file included from C:\Users\S�bastien\Documents\Arduino\libraries\MCUFRIEND_kbv\utility/mcufriend_shield.h:16:0,
from C:\Users\S�bastien\Documents\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:35:
C:\Users\S�bastien\Documents\Arduino\libraries\MCUFRIEND_kbv\utility/mcufriend_special.h:529:2: warning: #warning USE_MEGA_8BIT_PORTC_SHIELD for Mihael54 [-Wcpp]
#warning USE_MEGA_8BIT_PORTC_SHIELD for Mihael54
^~~~~~~
In file included from C:\Users\S�bastien\Documents\Arduino\libraries\MCUFRIEND_kbv\MCUFRIEND_kbv.cpp:35:0:
C:\Users\S�bastien\Documents\Arduino\libraries\MCUFRIEND_kbv\utility/mcufriend_shield.h:18:2: warning: #warning WE ARE USING A SPECIAL CUSTOM DRIVER [-Wcpp]
#warning WE ARE USING A SPECIAL CUSTOM DRIVER
^~~~~~~

What is LCD_ID_Reader.ino ?
There is no example called this.

Please do not post screenshots. It is really annoying to download several images. I can't read them without "magnify". I can't copy-paste them.

You seem to have installed libraries. Made the correct SPECIAL edits.

Please run graphictest_kbv.ino example. Your edit looks ok.

  1. What ID is reported on Serial Terminal ?
  2. What graphics are displayed on the screen ?

Please edit line #47 of diagnose_TFT_controller.ino

        uint16_t guess_ID = 0x7796; // write-only shield

Build and Run diagnose_TFT_controller.ino
Copy-paste from the Serial Terminal.

If you have only got White screens, please post a photo of your pcb.
I need to see how many integrated circuits. And any configuration links.
i.e. does the item on your desk match the photos in the LCDWIKI link from #0 ?

David.

Hi David,

first of all I have to say thank you for your patience, and my problem is solved !

I think that everything was allready solved thanks to your first reply... but I thought that having red warning lines when I was building the program could make my Arduino MEGA having troubles, so I didn't uploaded it to the Arduino.

I did upload it to give it a try, and :slight_smile: everything works fine !

"What is LCD_ID_Reader.ino ?" ==> Sorry I meant "diagnose_TFT_support"

I have taken pictures of my display screen and my arduino MEGA just if it could help other people.
My screen pcb is the same as shown in #0

Thank you again !

I am pleased that you have it working now.

Yes, it is very important to get the spelling correct. You can always edit your posts to correct any typos. If it is a major edit, just make a note to explain your changes.

Yes, it looks as if you have exactly the same pcb as shown in the #0 link.
You can just say : "My screen pcb is the same as shown in #0"
i.e. https://ae01.alicdn.com/kf/Hab5ddef5044d474592a3f6d42759d402w.jpg

David.

I have tried to run other examples:

The following ones work fine when forcing id "0x7796"

  • diagnose_TFT_support
  • Font_simple
  • scroll_kbv
  • testcard_kbv

I am now interested in making the touchscreen work ... none of the examples worked :

  • button_simple

Problem : C:\Users\SBASTI~1\AppData\Local\Temp\arduino_modified_sketch_548030\button_simple.ino: In function 'void setup()':
C:\Users\SBASTI~1\AppData\Local\Temp\arduino_modified_sketch_548030\button_simple.ino:55:75: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
on_btn.initButton(&tft, 60, 200, 100, 40, WHITE, CYAN, BLACK, "ON", 2);
^
C:\Users\SBASTI~1\AppData\Local\Temp\arduino_modified_sketch_548030\button_simple.ino:56:77: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
off_btn.initButton(&tft, 180, 200, 100, 40, WHITE, CYAN, BLACK, "OFF", 2);
^

  • diagnose_Touchpins
    Monitor says: Making all control and bus pins INPUT_PULLUP
    Typical 30k Analog pullup with corresponding pin
    would read low when digital is written LOW
    e.g. reads ~25 for 300R X direction
    e.g. reads ~30 for 500R Y direction
    Screen still white
    (I've tried to touch my screen, nothing happened)

  • TouchScreen_Calibr_native

libraries\MCUFRIEND_kbv\TouchScreen_kbv.cpp.o (symbol from plugin): In function TSPoint_kbv::TSPoint_kbv()': (.text+0x0): multiple definition of TSPoint_kbv::TSPoint_kbv()'
sketch\TouchScreen_kbv.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries\MCUFRIEND_kbv\TouchScreen_kbv.cpp.o (symbol from plugin): In function TSPoint_kbv::TSPoint_kbv()': (.text+0x0): multiple definition of TSPoint_kbv::TSPoint_kbv()'
...
sketch\TouchScreen_kbv.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries\MCUFRIEND_kbv\TouchScreen_kbv.cpp.o (symbol from plugin): In function TSPoint_kbv::TSPoint_kbv()': (.text+0x0): multiple definition of TouchScreen_kbv::TouchScreen_kbv(unsigned char, unsigned char, unsigned char, unsigned char)'
...
sketch\TouchScreen_kbv.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries\MCUFRIEND_kbv\TouchScreen_kbv.cpp.o (symbol from plugin): In function TSPoint_kbv::TSPoint_kbv()': (.text+0x0): multiple definition of TouchScreen_kbv::pressure()'
sketch\TouchScreen_kbv.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1

Does someone has a clue ?

Regular Mcufriend Uno shiekds have a bare resistive Touch Panel.
Your Surenoo Mega2560 shield has an XPT2046 Touch controller chip.

You have to use a XPT2046 style Touch version.

I have attached a XPT2046_Calibration.zip on this site a few months ago.

But I intend to post a more universal project within a day or two.

David.