Helping with SPI TFT 2,4" needed Bodmer eSPI_TF

Hello,
Iám looking for helping with my TFT SPI 2,4" 240x320 with ILI9341 Chipset.
I the past I get i to so good work with a special Library, but I do not know more which one.
The sample I have already mounted was a analog clock which works alreaay fine.

But I do not have the scetch anymore.
Now Iám triyng a lot, but I do not get the same result, like in the Past

Actually I have the Arduino_GFX-master.zip, which works.
under these condiditions:

19 MISO
23 MOSI
18 SCK
2 D/C
15 CS
1 Reset

But his Lib is not so fine and confortbale as the last I had ! For sure.

I thing I had something like from Bodmer in the past.
,like the TFT_eSPI-master.zip.

But I do not get it more to work. I thing there was something special to take care.

Is there anybody in the hole wide world who can support me to get the

TFT_eSPI-master.zip

to works fine with my ESP32 Wroom 32u and the 2,4" SPI TFT with ILI9341 Chipset.

I read a lot that I must change the Setupfiles, I do this, but nothing happens.
I were so happy if there is anyboday to can guide me how to change the Setupfiles and which place to store , for compiling and using. I thing this was the Bug by myself.
So that the sample clock form eSPI works an a seconds device

Iám lokking for your helping words.
Rainer

Setup1 is configured for ESP8266.
Setup46 is configured for ESP32 but you just need to change the DRIVER e.g.

#define ILI9341_DRIVER

Save it as your custom setup. Follow the recommended wiring specified in Setup46.

TFT_eSPI should work flawlessly when you have the correct User_Setup.

When you have run all the TFT_eSPI examples with this setup, you can customise the wiring.

David.

1 Like

Hi David,
this is exacly I have the understanding problems.
Which is Setup 1 and which is Setup 46.
Of course I understand inner the Setup what to do, but with the customer Setup save and the path were there comes muddle.
Yes I trie the original Wires, but without result.
I make something wrong by making the user setup , name it and save it , but were ?!
This is my problem. I do not know were I must edit and were save and place the right file.
There are so many files to edit !
There is a hint in the doku to rename the Setup, but not which one. IF I do this not then the doku says , at compiling was used a the standard setting and nothing work.

These all I have test, renamed and so on. ... no result.
I become here real little crises... :slight_smile:

These Files I Have in the Lib for edid:

User_Setup_Select.h
User_Setup.h
TFT_espi_Setups.h
TFT_eSPI.h
TFT_eSPI.cpp

...and the scetch take these, and I do not know, which insteadt.


#include <TFT_eSPI.h> // Hardware-specific library      ---> Which  exactly for me ? 
TFT_eSPI tft = TFT_eSPI();       // Invoke custom library   ---> Which  exactly for me ? 

What I will say is, which file exaclty (name and ending) I must edit for my ESP32 + ILI TFT.
How shot I renname it and were I must save it, that it works while compiling.
And final , what command I must you then in Scetch with which of my user Config Files.

You see , it is the handling of the editing files( clear name with ending) then ,clear renaming include ending and saving path for using by compiling.
Therewere is the doku for me absolutely not good, to many missunderstandings.
Or Iám so crazy meanwhile that I do not more clear see the real procedure.

Best Regards Rainer

This is the file on my PC.
C:\Users\David Prentice\Documents\Arduino\libraries\TFT_eSPI\User_Setups\Setup46_GC9A01_ESP32.h

This is my personal Setup file.
C:\Users\David Prentice\Documents\Arduino\libraries\TFT_eSPI\User_Setups\Setup_kbv_ILI9341.h

and it is selected via this line


#include <User_Setups/Setup_kbv_ILI9341.h>  // Setup file configured for my ILI9341

from my

C:\Users\David Prentice\Documents\Arduino\libraries\TFT_eSPI\User_Setup_Select.h

Yes, Bodmer's configuration is a bit complicated but it is much easier than configuring specials for MCUFRIEND_kbv

But once you have got your User_Setup working, you never need to worry again.

Bodmer provides lots of example Setups to suit most people.

David.

Hi Rainer,

MISO is not necessary. Disconnect from the ESP32.

I really like the ESP32-WROOM together with a SPI ILI9341 TFT display. You can enjoy a description " ESP32-WROOM-32 and ILI9341 TFT display – an interesting match on TheSolarUniverse ---> (ESP32-WROOM-32 and ILI9341 TFT display – an interesting match – thesolaruniverse) " on The BH1750 photometric light sensor: Arduino application – thesolaruniverse

This is my own setup for the WROOM-SPi TFT ILI9341 - this setup is saved in the directory TFT_eSPI\User_Setups, and it is called in User_Setup.h:
(what you see below is the setup_special_ILI9341_SPI_TFT_ESP32WROOM_OK.h = i.e. a file with all unnecessary comment lined removed)

// USER DEFINED SETTINGS
// Set driver type, fonts to be loaded, pins used and SPI control method etc
//
// See the User_Setup_Select.h file if you wish to be able to define multiple
// setups and then easily select which setup file is used by the compiler.
//
// If this file is edited correctly then all the library example sketches should
// run without the need to make any more changes for a particular hardware setup!
// Note that some sketches are designed for a particular TFT pixel width/height

// ##################################################################################
//
// Section 1. Call up the right driver file and any options for it
//
// ##################################################################################

// Only define one driver, the other ones must be commented out
#define ILI9341_DRIVER

// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red

// ##################################################################################
//
// Section 2. Define the pins that are used to interface with the display here
//
// ##################################################################################

// sketch. e.g. with digitalWrite(TFT_BL, LOW);

#define TFT_BL 32 // LED back-light control pin
#define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)

// ##################################################################################
//
// Section 3. Define the fonts that are to be used here
//
// ##################################################################################

// Comment out the #defines below with // to stop that font being loaded
// The ESP8366 and ESP32 have plenty of memory so commenting out fonts is not
// normally necessary. If all fonts are loaded the extra FLASH space required is
// about 17Kbytes. To save FLASH space only enable the fonts you need!

#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 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT

// ##################################################################################
//
// Section 4. Other options
//
// ##################################################################################

// #define SPI_FREQUENCY 20000000
#define SPI_FREQUENCY 27000000

// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000

// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000

// Transaction support is needed to work with SD library but not needed with TFT_SdFat
// Transaction support is required if other SPI devices are connected.

// Transactions are automatically enabled by the library for an ESP32 (to use HAL mutex)
// so changing it here has no effect

// #define SUPPORT_TRANSACTIONS

1 Like

How wonderful this "improved" user interface of the forum :face_with_symbols_over_mouth:

Dear photoncatcher,
sorry for the late reply. But I was in hospital for few days.
So , now everything is good, already.
I try your settings, but it do not works.

Hmm, I do not know what I do, I thing i was so wrong, that the comes nothing to a right result.

I know , that I works in the Past , because I have here one device which works
But I do not save the Sketch.

How do you can help me ?
This is so strange, that I could take a hammer and destroy the Bullshit.
I do not know where my minds are.

Can we begin please , from beginning like install the lib.

  1. Install TFT_eSPI
  2. Load Sample TFT_e_SPI...320x240...TFT_Clock.
  3. Compile and flash
  4. works fine

Please :slight_smile:

With THE GFX Driver , I get a Hello World, but the wished Bodmer
do not works ....

This works fine, so Hardware and connections is ok.
Hopefully , somebobdy can guide me to the Bodmer working.
I really becoms crazy.


// ---> BIB: Arduino_GFX-master.zip    Siehe Samples im LIB Ordner

 
#include <Arduino_GFX_Library.h>
 
#define TFT_SCK    18
#define TFT_MOSI   23
#define TFT_MISO   19
#define TFT_CS     15
#define TFT_DC     2
#define TFT_RESET  1
 
void setup(void)
{
 
  Arduino_ESP32SPI bus = Arduino_ESP32SPI(TFT_DC, TFT_CS, TFT_SCK, TFT_MOSI, TFT_MISO);
  Arduino_ILI9341 display = Arduino_ILI9341(&bus, TFT_RST, 0 );


  display.begin();
  display.fillScreen(BLACK);
  display.setCursor(20, 20);
  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.print("Hello world");

}
 
void loop() 

{
  delay(500);
 }

Maybe an EMail with zipped Files all of eSPI for ESP32 and ILI TFT.
So I only must change the Pins ?

Concentrate on Bodmer's TFT_eSPI library.
Forget about other ESP32 libraries like Arduino_ILI9341

I strongly advise you to use the appropriate User_Setup for ESP32 and adjust for ILI9341 as in #2.

As soon as you have got the correct User Setup every example will work out of the box.

If you want help with adapting other projects for TFT_eSPI just link or paste your original sketch.
Most GFX-style code should work with little alteration.

David.

I try to concentrate to Bodmer,
but I do not know what is the User_Setup for ESP32 and adjust for ILI9341 as in #2.
This is exact the Problem.
I tried all after Guide and it do not work.
So my Wish to guide me from begiining the Lib to the sample.
We are going in circle.

I have understandiung Problmes, and no guide makes a fuction.
I Follow the Link of photonctacher, but it also do not works.

I have here one sample with ESP32 and ILI from months ago.
with the Pinning listed above an the Clock Sample Works.
But I do not get a second device to work.

So please guide me step by step. Name by name.
Folder , by folder.

Rainer

My Rainer_Wroom32_ILI9341.h



#define ILI9341_DRIVER


#define TFT_CS   15  // Chip select control pin D8
#define TFT_DC   2   // Data Command control pin
#define TFT_RST  1   // Reset pin (could connect to NodeMCU RST, see next line)


#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 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6  // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7  // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8  // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
#define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts






#define SMOOTH_FONT
#define SPI_FREQUENCY  40000000
#define SPI_READ_FREQUENCY  20000000
#define SPI_TOUCH_FREQUENCY  2500000


My User_Setup_h

// USER DEFINED SETTINGS
// Set driver type, fonts to be loaded, pins used and SPI control method etc
//
// See the User_Setup_Select.h file if you wish to be able to define multiple
// setups and then easily select which setup file is used by the compiler.
//
// If this file is edited correctly then all the library example sketches should
// run without the need to make any more changes for a particular hardware setup!
// Note that some sketches are designed for a particular TFT pixel width/height

// ##################################################################################
//
// Section 1. Call up the right driver file and any options for it
//
// ##################################################################################

// Only define one driver, the other ones must be commented out
#define ILI9341_DRIVER

// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red

// ##################################################################################
//
// Section 2. Define the pins that are used to interface with the display here
//
// ##################################################################################

// sketch. e.g. with digitalWrite(TFT_BL, LOW);

#define TFT_BL 32 // LED back-light control pin
#define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)

// ##################################################################################
//
// Section 3. Define the fonts that are to be used here
//
// ##################################################################################

// Comment out the #defines below with // to stop that font being loaded
// The ESP8366 and ESP32 have plenty of memory so commenting out fonts is not
// normally necessary. If all fonts are loaded the extra FLASH space required is
// about 17Kbytes. To save FLASH space only enable the fonts you need!

#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 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT

// ##################################################################################
//
// Section 4. Other options
//
// ##################################################################################

// #define SPI_FREQUENCY 20000000
#define SPI_FREQUENCY 27000000

// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000

// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000

// Transaction support is needed to work with SD library but not needed with TFT_SdFat
// Transaction support is required if other SPI devices are connected.

// Transactions are automatically enabled by the library for an ESP32 (to use HAL mutex)
// so changing it here has no effect

// #define SUPPORT_TRANSACTIONS

No function result......

Hi Rainerkol,

Photoncatcher has another link for you: http://www.zonnepanelen.wouterlood.com/arduino-projecten/

I advise you to pick your matching project and have fun. Any questions can be addressed here on the forum.
regards, Photoncatcher
( don't hammer the bullshit! It isn't)

tft_espi works and works well BUT there are possible problems that i cant pin point for pi pico that caused white screen but for esp32 it works fine. adafruits l;ibrary worked on pi pico. its not my thread but i think its about the actual spi pins.

so tons of flavors of boards and esp32 is probably the worst for this. which pins are which. there is a ttgo board that is set up to share stuff like camera and spi .

adafruits probably worked because of how it called the spi pins. tft espi uses a different bit of code. i dont think adafruits uses real hardware spi even when the pins are the same

Hi mrseriousguy
Maybe my posts on TheSolarUniverse may help. There are several posts on ESP8266, ESP32 and various TFT boards. Plenty of pins to choose from. Pick yours!
regards, Photoncatcher

Hi mrseriousguy,

Apparently the ^C and ^V were still impressed by the tanker attack in the Gulf of Oman.

here is the SolarUniverse link: https://thesolaruniverse.wordpress.com/
regards, Photoncatcher

see now you dun did it. i had given up on the dream of using tft espi by itself practically for a stream lined retro game engine with the death of my pi pico and had resigned the esp32 to a life of mediocrity at the hands of arduboys 1 bit screen existence.

they dont have practically any code you need. a pointer for a buffer thats it really. tft_espi has all the line draws and rectfills you need. i dont need no led code. with lge and pokitto out its time to strike while the irons hot and work on tft_espi boy

Nice, can you start a project thread and share. I'd love to see your results. I'm sure others would too.

Hi photoncatcher.
I'm about a topic closed by a moderator [(bitmap display on 130*130 SSD1283A TFT display - #3 by david_prentice)]
I want to ask you to throw off a sketch, then how did you manage to do it. And did you manage to display a color image on the SSD1283A 130*130 display?
Thank you in advance!

Hi Sergio,

Please find attached my Donald Duck bitmap display on the 130*130SSD1283A. Note that the entire anatide picture is in progmem and not a file on an extenal sd card. No color pictures tried yet.

best wishes,

Photoncatcher

Nano_130x130_TFT_duck_120x120_progmem_003_OK_works.ino (56.4 KB)

2 Likes

Thanks for the sketch.
But I have a question: in which program or on which site did you convert the image to a byte array?