[RESOLVED] ESP32-S3-Touch-LCD-1.28 and esp-idf/tree/master/examples/peripherals/lcd/spi_lcd_touch

oshmykov-dev
Posts: 5
Joined: Tue Apr 23, 2024 5:02 am

[RESOLVED] ESP32-S3-Touch-LCD-1.28 and esp-idf/tree/master/examples/peripherals/lcd/spi_lcd_touch

Postby oshmykov-dev » Tue Apr 30, 2024 7:03 pm

Hello,

I am trying to build the "peripherals/lcd/spi_lcd_touch" example for the https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-1.28 board.

I was able to run this example https://github.com/espressif/esp-idf/tr ... _lcd_touch successfully but I cannot figure out how to enable the touch feature.

This is the controller for the board I used https://github.com/espressif/esp-bsp/tr ... ch_cst816s

After following these instructions I can detect the touch but X and Y coordinates are always 0.

Then I figured this is a I2C protocol which is not configured at all as in this example:
https://github.com/MohammedBENHADINE/cst816d_test
Unfortunately this one also does not work and it is complaining the i2c driver is too old. Also this code freezes often once I touch the screen.

I changed it to the newer version following this example to configure I2C Bus master and device
https://github.com/espressif/esp-idf/tr ... d/i2c_oled

Here is the final version so far: https://github.com/oshmykov-dev/esp-idf ... _lcd_touch

Steps to build:

Code: Select all

1. cd %userprofile%\esp
2. xcopy /e /i %userprofile%\git\esp-idf\examples\peripherals\lcd\spi_lcd_touch spi_lcd_touch
3. cd %userprofile%\esp\spi_lcd_touch
4. idf.py set-target esp32s3
5. idf.py menuconfig
6. Example Configuration ---> LCD controller model set to (GC9A01)
    6.1. [ ] Enable LCD Touch
          6.1.1. LCD touch controller model ---> Choose (CST816S)
7. Save and Quit
8. idf.py add-dependency esp_lcd_touch_cst816s==1.0.3
9. idf.py build
10. idf.py -p <PORT> flash monitor
Observe the animation is working fine and the touch is detected but it is always returning "touch pressed = 0 , x = 0 , y=16329" in the logs. The numbers do not ever change.

If you have any general thoughts like what components or steps are required to configure this board correctly or a working code please share. Thank you very much for any help.

https://files.waveshare.com/wiki/ESP32- ... 28-Sch.pdf
https://www.buydisplay.com/download/ic/GC9A01A.pdf
https://www.buydisplay.com/download/ic/ ... S_V1.3.pdf

oshmykov-dev
Posts: 5
Joined: Tue Apr 23, 2024 5:02 am

Re: [RESOLVED] ESP32-S3-Touch-LCD-1.28 and esp-idf/tree/master/examples/peripherals/lcd/spi_lcd_touch

Postby oshmykov-dev » Fri May 03, 2024 9:24 pm

Here is the fixed 'hello world' example for the ESP32-S3-Touch-LCD-1.28.

https://github.com/oshmykov-dev/cst816d_test

I moved the main loop from the original repository to a separate task which helped to avoid freeze and set levels.reset to 0 as in the original documentation.

The esp_lcd_touch_cst816s.c uses the old version of i2c.h and that's probably why it didn't work in the lcd touch example.

tank104
Posts: 5
Joined: Mon May 06, 2024 9:45 pm

Re: [RESOLVED] ESP32-S3-Touch-LCD-1.28 and esp-idf/tree/master/examples/peripherals/lcd/spi_lcd_touch

Postby tank104 » Mon May 06, 2024 9:48 pm

Hi,
How did you get the touch chip CST816S to show up in the menuconfig?

I can only see STMPE610.

I tried install the touch component but still doesn't show in menuconfig.

Sorry if a bit of a silly question, but driving me a bit crazy.

tank104
Posts: 5
Joined: Mon May 06, 2024 9:45 pm

Re: [RESOLVED] ESP32-S3-Touch-LCD-1.28 and esp-idf/tree/master/examples/peripherals/lcd/spi_lcd_touch

Postby tank104 » Sun May 12, 2024 8:05 pm

Sorted it out by adding to the menu configs - now see how all that works.

Also changed the code to add compiler ifdef for my chip and its working.

Thanks,


Who is online

Users browsing this forum: No registered users and 325 guests