I am using a Esp32s3 dev board with 1.28 round screen attached (from waveshare). i am able to export and upload the code to the board but when i remove the false for touched and uncomment the " tft.getTouch( &touchX, &touchY, 600 ):" the error message received is “class TFT_eSPI’ has no member named ‘getTouch’; did you mean ‘getColor’?” Now there are claims online to have the TOUCH_CS pin defined, but this particular module does not have a TOUCH_CS pin as stated by the manufacturer of the board. This is their statement: “The touch LCD communicate the ESP32 via i2c inteface instead of the SPI, in this case, it doesn’t have Touch_CS pin” i am able to get the module to display as a normal LCD but i am unable to get it to register touch. please provide a solution to this. Kind regards
TFT_eSPI library doesn’t seem to support I2C touch by default, just SPI (not sure about this I2C version: GitHub - kostuch/TFT_eSPI_I2C: Arduino and PlatformIO IDE compatible TFT library optimised for the STM32, ESP8266 and ESP32 that supports different driver chips (with pins connected via PCF857x port expander)), and only for certain touch-controllers like XPT2046. You might have a different touch-screen chip. I guess you’ll need to use a custom library to use that touch-screen, independently from the SPI-based working TFT driver.
I am having issues myself being able to use the TFT library with the development board, but mine does not even have a touch screen option. I can make it work with the other type of display that they have where you connect to an external microcontroller instead of using the embedded ESP32-S3R2.
So I am concerned that the TFT library is just not compatible with the development board. Have you seen proof of it being used with this particular board?
Are you able to flash anything on the screen and actually display something using the TFT library?
I was able to get mine to work. I was able to tweek the the solution provided by Hermit to get the touch to work. i was already able to get the display to work and that link that Hermit shared helped me sort out the touch issue. which waveshared device are you using. go ahead and shared the link to the device
@raj Are you using the Waveshare ESP32-S3 Development Board with 1.28 inch Round Touch Display? How did you get your touch to work? I can’t figure it out
dont worry, someone scratched by back and i will scratch yours. let me explain. trying to relocate the link that helped me as to not make any mistake in my explanation
Now for background, squareline studio only supports SPI interface (a single pin) for the touch to work. In the case of the board provided by waveshare, the touch chip used is CST816S which only supports i2c interface (4 pins)
The UI.ino code only checks for touch using different functions not supported by the CST816S touch chip. what you need to do is to simply make the configuration so it registers with that particular touch chip.
Now follow the steps exactly has stated under this link (follow the steps made by [cdchristian] at the top of the page. only change you would make are as follows:
where it says:
“CST816S myTouch(18, 17, 21, 16); //Add this line”
for the board waveshare provides you will add this instead:
“CST816S myTouch(6, 7, 13, 5); //Added this line”
Note that this only resolves the touch issue. You would follow the steps to setup the TFT/LCD (display) as stated by squareline studio. for that part best to use the TFT_espi and LVGL folders generated by squareline studio instead of the one provided by waveshare.
Only change you would have to make then is to the “User_Setup.h” file found in the TFT_espi folder. Copy whats inside the setup file provided by waveshared (TFT_eSPI_Setups > Setup207_GC9A01.h) then paste it inside the User_Setup.h exported from squareline.
Also its important to note that higher versions of LVGL and ESPI has been noticed to cause issues. I am using
LVGL - 8.3.6
TFT_espi - 2.5.43
comment if you have any further questions
Thank you so much!!! it works now
glad to hear it
this is the one I am using. I cannot get anything to work using the TFT library or the adafruit_GFX for that matter. Only thing I can think of is that I have the wrong set up files and pin definitions. But I have a working demo file and I matched the pins exactly and I still cannot display anything.
Does it matter that I have a USB-C connection?
Is there some sort of set up I need to establish in the code regarding that?
There are a lot of ingredients to it, some measurements might come handy. Just for a tip, maybe adjusting SPI frequency or SPI signal phases/polarities to match what is given in the display chip’s datasheet?
So I have the same exact display but without the built in microcontroller, and I was able to send and display things on that one. and they both have the same display driver, and both the external and built in microcontrollers are ESP32. So I do not think the SPI frequency is the issue. I just cannot establish a connection to the LCD display at all. I connected an oscilloscope to the clock terminal to see if any signals are being sent from the built in microcontroller to the LCD display. And I am getting nothing.
That could mean the controller doesn’t send the data out. Cause might be inadequate hardware-setup code for the controller (so SPI interface is not activated), or lack of pixel-data sending. I’d build up gradually in your case, trying with setting up the most basic SPI communication first, i.e. continuously sending some data (e.g in the main loop or flush-callback), and then check the difference why the driver code and config doesn’t do the same. Some printf/debug in certain places could reveal if the flush and callback SPI writing code is running or not. A Spinner widget might be enough to stimulate change and see if data is sent out (the flush/driver code might optimize bandwidth by sending only changes.) Systematic checking of the ‘signal’ chain from LVGL to the display is what could help here, if no other tips are coming from experience.
@SaraMirza, what kinf of micro controller are using and describe the pin setup. Also, please comment on the display driver of the screen you are using.
Okay I will start from the top.
So I am working on two displays from Waveshare. Both use GC9A01 as the display driver.
One is:
1.28inch Round LCD Display Module, 65K RGB Colors, 240×240 Resolution, SPI Interface
This one I connect to an ESP32 Feather board. I am able to get this one to work with the TFT_eSPI library. and I will refer to this as Display A. All I needed to do was uncomment the correct User_setups file in User_Setup_Select.h, make sure that the pins are configured correctly, and also make sure that the correct driver is enables in User_Setup.h
The other display is:
This display, which I will refer to as Display B, has an embedded ESP32-S3. And I cannot get this one to work with the TFT_eSPI library. However I can get it to work with a demo file provided by Waveshare called esp32-s3-lcd-1.28-demo.ino.
The demo script does not use any external library (does not use TFT_eSPI), everything needed is encompassed within the script folder in different .h or .cpp files. And in the DEV_Config.h file, the following pin declarations are made:
#define LCD_DC_PIN (8)
#define LCD_CS_PIN (9)
#define LCD_CLK_PIN (10)
#define LCD_MOSI_PIN (11)
#define LCD_MISO_PIN (-1)
#define LCD_RST_PIN (12)
#define LCD_BL_PIN (40)
This script works and the Display B shows exactly what is expected. I believe SDA and SCL were declared as there is an embedded sensor in the display that was used and so data needed to be outputted.
Now, waveshare also provided the TFT_eSPI files to use. So I have the User_setup.j and User_Setup_Select.h files that are written by Waveshare to make the display work. And I double checked the pin configurations and they match the configuration file from the demo that works. I also checked that the right line was uncommented to include the correct User_Setups file, and that the right driver was decalred. Picture attached.
But when try to use the Color_test script from test and diagnostics. I get nothing on the display, and I connect my oscilliscope to the CLK pin and I get no signal. Unlike when I get the demo file working.
I tried running the Read_User_Setup.ino and I get this error in the Serial Monitor.
Guru Meditation Error: Core 1 panic’ed (StoreProhibited). Exception was unhandled.
I tried running an ESPExceptionDecoder that was suggested online but did not get anywhere.
So I cannot figure out what I am missing. For Display B, I have one script that doesn’t use TFT_eSPI that works, and the one that does use TFT_eSPI that doesn’t, and they both have the same PIN configurations. And I know how to make TFT_eSPI to work because I can get it to on Display A that uses the external microcontroller.
So what can I possibly be missing that I can look into?
I really appreciate your time.
I replied to Raj below that might give you more insight of what I am facing. I really appreciate your time. I do have a script that works and outputs data, but that script has so many embedded files that I need to look into to see what it is doing different that it is able to establish the SPI connection. I was under the impression that I needed to configure the LCD pins so that the ESP32-S3 can communicate properly with the display, but I do think you are right, I am missing something else that established that SPI communication. I just can’t figure out what it is. This is the first time I use an embedded microcontroller.
Ensure that you use the LVGL and TFT library provided by the squareline software when you do the export
then you should have already downloaded waveshares recommended library folder.
inside that folder go to TFT_eSPI_Setups > Setup207_GC9A01.h, then copy everything inside this file. then paste it inside the squareline setup folder
That is circuit UI folder > library folder > TFT_espi folder > User_Setup.h
take what you got from Setup207_GC9A01.h and paste it in User_Setup.h
On arduino IDE, ensure that you go to file > preference > then ensure that the sketch location is set to where it can see the library folder that holds all the squareline studio exports
ensure that you already have the necessary boards installed
here is the additional board manager URL link, paste it where it applies in preference settings of arduino IDE : https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Then you should be good to go. if you are having issues. please sent pictures showing the configuration of the folders from squareline and the arduino sketch location. Also comment on error message if any
kind regards
Hello - I have just joined Squareline Studio and it feels like there is great unification and respect for each other within this blog. I caught a thread of this discussion after desperately searching for information regarding why my Waveshare ESP32-S3-LCD-1.28 is not working within the Ardrino IDE. I even tried to use PlatformIO with similar results. Last year I lost a contract to utilize the Lilygo T-RGB due to spinning over a long 2 weeks to just bring it up with example applications (I would like to address this later).
My project objective is to have a non-display ESP32-S3 at the sensor collection level comminicating over BTLE to the Waveshare ESP32-S3-LCD-1.28-B for a local small display having the ability to concurrently view (numerically and graphically) 2 or three of the sensor values selectable through touch operations having the ability to scroll thru the potentially 15-20 sensors being monitored.
The low end unit will concurrently be able to connect via wifi as a sever to stream the sensor data to a connected smartphone or laptop for in depth analysis of the sensor data streams.
For nearly 2 weeks now I have been attempting to bring up the LCD (I can run BLE and wifi examples but cannot get a single pixel displayed on the LCD).
Even though I am successfully building, loading, and running some of the Arduino wifi and ble examples, I do not receive any serial outut to the Ardrino Serial monitor even though I have set the port and data rate for the connection correctly. It may have something to do with the Output terminal statement that a hard reset was done at the end of program load (no way to do it). I am sure it is probably a simple setting but I cannot find it.
I observed in this series of posts the possible availability of the library files that can be used to replace the Waveshare supplied files to bring up the LCD.
I also have pondered whether to attempt to bring up the ESP32-S3-LCD-1.28 in Micropython. I have several years of experience using Micropython, Circuitpython, and the RPI ported Micropython in a number of rapid developments. I was literally minutes away from trying the Micropython approach to see if the LCD would come up when I found this thread with a possible answer to bringing my project forward with the Arduino IDE since Arduino has many more examples that demonstrate the capabilities I need.
Is there anyone familiar with the Serial Monitor to help me bring that capability up correctly?
And is there a way I can get a copy of the appropriate libraries to bring up the Waveshare LCD (since I am a newbie to Squareline Studio and do not yet have access to the software)? I can likely follow the great instructions in this thread if I can get a copy of the libs. I will definitely get back with the Studio on the results of my effort to quickly bring up this capability.
I look forward to being a member of this organization and sharing my issues and solutions with the members. It is really frustrating to have companies deliver non-workable software to you to bring up a device - especially when you are in a tight timeline to demonstrate a capability.
Thank you,
Gary
I can totally understand your frustation if the software provided doesn’t work, I face it time-to-time, it can be very time-consuming.
I don’t have this exact board and display at hand to test for a solution, but checked the webpage of this circular board and it’s seen the LCD display is driven thourgh SPI and has GC9A01 LCD-controller chip. The linked display-driver and settings zip-file contains the tested Setup207_GC9A01.h user-setup file which is also selected in the included TFT_eSPI/User_Setup_Select.h. Hopefully you followed all the instructions at the Waveshare page and put the TFT_eSPI and TFT_eSPI_Setups into the library folder (contained by sketchbook-location set in preferences), otherwise it wouldn’t even compile. If this really worked for them, it should work for you too. Hopefully you’re not facing a faulty display…
Did you try the LVGL sample codes provided at the end of the Waveshare page (without any modification/addition)? Does at least the backlight come up which is set by a separate GPIO (GP40)? (I can also see the display-SPI is driven at 80MHz in the setup, what about lowering it?)
As for the serial port, I have no clue why it wouldn’t work, it’s a very basic feature in Arduino boards and software. It might depend on operating system and serial port settings, maybe others have some idea here. (I usually turn a LED on a GPIO at given points in the program, when I don’t have serial-port debugging, to at least see, how far the initialization code could go…)
Thank you for the information Hermit. I will follow up on your suggestions tonight and see if I make any more headway. I apologize for the late response but we had an emergency with our little doggie and have been focused on that for several days.
I will try to find the lvgl examples again and try them. As I recall, they also had issues. I do have a second display to try but have been hesitant to do that yet until I am sure that errant code did not damage the one I have been using. The wifi and bluetooth work on the board and I can do everything but talk to the display.
Again, thanks and I will let you know how much progress I have made.