ESP32-C3 and ILI9341

I tried multiple connections (with the help of 5 different AI’s) to get a ILI9341 to work with an ESP32-C3. My display is this one : https://europe1.discourse-cdn.com/arduino/original/4X/3/4/d/34daebf1003dbfe82e0f0e840544556466cd9495.jpeg

I used the proposed sketches with the proposed User_Setup.h in the sketch folder.
ALL of them gave me a white screen.
I tried a VCC of 5V and a VCC of 3.3V on the display…
I tried Adafruit’s library…
I tried Bodmer’s library…
I tried different displays (as in the link above)
Nothing seems to work … :sleepy_face: (although they all compile OK.)

Is there anyone who has a working combination ?

big thanks in advance !!!

PS: I use an external 5V power supply

show how you connected the display with the TFTeSPI library

I’ll come back later. Apparently I can’t paste my Exel here with all the connections I tried …

CYA later !

Any sketch from the TFTeSPI library works on these pins

#include <User_Setup.h>
#define TFT_CS   7
#define TFT_MOSI 6
#define TFT_MISO 5
#define TFT_SCLK 4
#define TFT_DC    8
#define TFT_RST   10

Maybe you did not give the AI’s enough information.

Not the greatest picture and no technical information.

I do not have that folder, post a link to it.

Unlike AI I need an annotated schematic showing exactly how you connected everything and links to technical information on the parts you used. Post your best code using code tags.

The picture I used, I found it here on the forum while I was searching for a solution for my problem. I have the exact some board.

Following instructions : when you put the User_Setup.h file in the sketch folder, that setup file will be loaded during compiling …

if you need more information : HERE you can find all the sketches + their User_Setups.h
I connected everything like shown in the User_Setup’s
I tried other displays (same make) and other ESP32-C3’s to be sure that the display or ESP isn’t faulty…

HERE you find a data sheet for the display I use.

Below you find the connections I made for the different examples the AI’s gave me :

Even more (complete) info about the ILI9341 you can find HERE.

Yes. With an ESP32-C3 (super mini) and an ILI9341 with touch screen (as yours but 2.8")

using these libraries:

image

Additional notes:

  1. The touch screen uses the same SPI bus as the TFT part and uses a hacked version of the "XPT2046_Touchscreen.h" library which has a reduced SPI clock speed. This is necessary only on some low quality touch screens.
  2. The display I used is similar to this: https://www.lcdwiki.com/2.8inch_SPI_Module_ILI9341_SKU:MSP2807

EDIT
schematic and corresponding description changed to simplify it.

This looks VERY promissing !
I’ll try it out immediatly and come back with the results !

Thanks in advance 6v6 !!!

This is a minimal example which I have just tested with the project I illustrated in post #9

#include <Adafruit_GFX.h>      // Core graphics library
#include "Adafruit_ILI9341.h"  // Hardware-specific library
#include <SPI.h>

#define TFT_DC 1   
#define TFT_CS 8  


Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);

void setup() {

  Serial.begin(115200);
  delay(1000) ;
  Serial.println("Starting . . .");
  Serial.print("MOSI: ") ;
  Serial.println( MOSI ) ;
  Serial.print("MISO: ") ;
  Serial.println( MISO ) ;
  Serial.print("SCK: ") ;
  Serial.println( SCK ) ;


  tft.begin();
  tft.fillScreen(ILI9341_BLUE);
  tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
  tft.setTextSize(2);
  tft.println("Hello World");
  
}

void loop() {
  delay(10);
}



EDIT
This is from the compiler output with selected board "ESP32C3 Dev Module":

Using library Adafruit GFX Library at version 1.12.1 in folder: C:\Users\6v6gt\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Adafruit BusIO at version 1.16.1 in folder: C:\Users\6v6gt\Documents\Arduino\libraries\Adafruit_BusIO 
Using library Wire at version 3.3.0 in folder: C:\Users\6v6gt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\libraries\Wire 
Using library SPI at version 3.3.0 in folder: C:\Users\6v6gt\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.0\libraries\SPI 
Using library Adafruit ILI9341 at version 1.6.1 in folder: C:\Users\6v6gt\Documents\Arduino\libraries\Adafruit_ILI9341 

and this is the serial monitor output:

11:57:07.670 -> Starting . . .
11:57:07.670 -> MOSI: 6
11:57:07.670 -> MISO: 5
11:57:07.670 -> SCK: 4

Dear 6v6gt, (or should I say : eighty-six years old vacuum tube… :wink: )

To keep it short : IT WORKS !!! :heart_eyes:

A little longer:
I connected everything like in your diagram and tried the example sketch “graphictest.ino” from Adafruit:

/***************************************************
This is our GFX example for the Adafruit ILI9341 Breakout and Shield
----> Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to interface (RST is optional)
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
****************************************************/
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
// For the Adafruit shield, these are the default.
// #define TFT_DC 1
// #define TFT_CS 8
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
// Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
// If using the breakout, change pins as desired
// Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
Adafruit_ILI9341 tft = Adafruit_ILI9341(8, 1, 2, 4, -1, 5);

As you can see : I changed the last line.

After searching and questioning different AI’s, YOU came up with THE solution !!!

Thousand times “thank you” would be terribly insufficient !!!
Lemme know what I can do for you in return ! :smiling_face_with_sunglasses:

PS. Also (albeit a few less :wink:) thanks to all who made the effort to try to help me with this problem.

Oops : forgot the link from Adafruit:

I have my moments!
Success stories are always good to hear so thanks for reporting back.
It is good enough for me that there is now a verified example around for others who are struggling with the combination of an ESP32-C3 and one of these quite common SPI screen types.

This is SPI software

OK. I did wonder what GPIO2 was in the OP's version of the solution.

Anyway, if anyone wants to use the graphicstest example: Adafruit_ILI9341/examples/graphicstest/graphicstest.ino at master · adafruit/Adafruit_ILI9341 · GitHub with the schematic in post #9, then the only changes, there are two, to make in the original code are marked as highlighted as shown:

I've just tested it and it works.

Hi there,
I tried out your code and your scematics and it works..... but unstable. in a few attemps it is working for roughly 10 sec then the display is more or less black again. Can i do something to get it more stable. hmmmm
a am using a DollaTek 2.8 Zoll LCD-TFT-LCD-SPI-Serial-Touch-TFT-Farbbildschirm with a esp32-c super mini.

I guess that you are referring to post #9. Did you observe points 1 and 2 in the text below the schematic, especially the resistor in the back light circuit ?

From your description it doesn't sound like a library incompatibility problem and more like a hardware issue, say the voltage regulator over heating or just a bad connection if you have built a circuit on a breadboard.

Can you show a picture of your display (both sides) where the pin labeling etc. is clear. I found a "DollaTek 2.8 Zoll LCD-TFT-LCD-SPI-Serial-Touch-TFT-Farbbildschirm" on amazon but the picture quality was too poor for this.

Hi and thanks for your quick reply.
here is the link to the display

and a better picture of the Pins

the official docu is:
Pin-Definition:

  1. GND (Leistungsmasse)
  2. VCC (Stromversorgung ist 3.3 V)
  3. CLK (Taktzeile)
  4. MOSI (Dateneingang)
  5. RES (Reset-Zeile)
  6. DC (Daten- / Befehlsauswahlzeile)
  7. BLK (Hintergrundbeleuchtung)
  8. MISO (Datenausgabe)
  9. CS1 (LCD-Chipauswahlsignal)
  10. CS2 (Touchchip-Chipauswahlsignal)
  11. PEN (Touch-Interrupt-Signal)

To be honest I used 1k resisotrs for the BL.....
i operate in 3,3Vs with the internal DC/DC from the SEP32C3 mini board at the moment, For the real project I will use an external DC/DC with 500mA for display and GPS Sensor.

ay be on the right way. I will change to an external PS with 3,3V..... but the serial montior shows, that the ESP running the prg.
But now I have to leave. I will check this tomorrow morning.

Thanks

EDIT

OK. The pinout is different to display I used but if it seemed to work, albeit for a short period, then I guess the wiring is correct.

Ideally, the display back light would be connected to the 5v and not the 3.3volt supply and the series resistor value chosen to ensure the maximum current delivered to the display backlight is not exceeded. This is to avoid stressing the onboard regulator of the microcontroller board. However, with your 1k resistor there is certainly no danger to the regulator but the screen may be very dim. Even the 100 Ohms I suggested could be much too high. Further, if you are using an external 3.3volt supply, then the onboard regulator of the MCU is anyway not used.

There are a number of varieties of the raw screen module with different back light arrangements so some tests/experiments are often required here.

Good morning,
i just tried some things out and with the Res Pin at 3,3V it is running stable or with your succession at 5V with 10k resistor. A little confusing.
Any ideas?

Thanks for your help :slight_smile: