platformio-espressif32-sunton icon indicating copy to clipboard operation
platformio-espressif32-sunton copied to clipboard

[ESP32-2432S024C] uses CST820 instead of CST816 and the INT GPIO is different

Open regystro opened this issue 1 year ago • 7 comments

Hi. I recently bought an ESP32-2432S024C, and can confirm that there are some changes regarding board definition: https://github.com/rzeldent/platformio-espressif32-sunton/blob/main/esp32-2432S024C.json

  1. The touch sensor is a CST820 instead of "'-D TOUCH_CST816S_I2C'"
  2. The Interrupt GPIO is 22 instead of "'-D CST816S_TOUCH_CONFIG_INT_GPIO_NUM=21'"

I tested it with https://esphome.io/components/touchscreen/cst816.html and works as expected.

regystro avatar Apr 11 '24 10:04 regystro

Hi Regystro,

Thanks for going into the depths of the smartdisplay library!

It is very well possible the sensor is a CST820. The library CST816S is upwards compatible so supports this touch screen chip. Making a new library for the same functionality is not worth the effort so will stick with this module.

The INT GPIO is not used; it is polled by LVGL. So this is not much of an issue but the definitions should be correct! I checked the schematic: image And it seems to be 21. Where did you find this information or did you measure/followed the tracks it on your board?

Kind regards,

Rene

P.S. Made a note about the driver in the documentation

rzeldent avatar Apr 11 '24 20:04 rzeldent

Hi Rene.

Regarding the INT GPIO, I have the same schematics and even the sample code uses GPIO21. Anyway, trying to get it to work with ESPHome -which can use interrupts and also polling- I found that disabling polling, only GPIO22 detects interrupts. It was a matter of trial an error. GPIO22 shows touch in the logs, while GPIO21 doesn't.

It could be a mismatch in ESPHome's GPIO assignation though :)

Regards.

regystro avatar Apr 11 '24 22:04 regystro

It is very well possible this this the case and they a really good find...

How can I reproduce this? Is there a little demo app to check for the INT

rzeldent avatar Apr 16 '24 14:04 rzeldent

I digged deeper and found that even setting an interrupt pin in ESPHome, which as per the documentation should stop using the polling method (= update_interval: never), with CST820 it's not working.

Long story short: I thought I was using interrupts while the code was using polling. I filled an issue to see if ESPHome developers can fix it: https://github.com/esphome/issues/issues/5708

regystro avatar Apr 17 '24 17:04 regystro

Okay, thanks for looking into this issue... So might be correct after all...

rzeldent avatar Apr 17 '24 18:04 rzeldent

Hello, i am working on the same display, only programming on arduino and i cant get that touch to work, could you help me?

Arunce159 avatar Nov 20 '24 17:11 Arunce159

Hello, the driver for CST820 is very simple, unfortunately I haven't found a complete datasheet to know how to activate the Interrupt pin (which is an output and must be read from a microcontroller input).

I found the driver for a 2.4 inch display, and it is available in this repository:

https://github.com/rtek1000/2.4inch_ESP32-2432S024

CST820_driver_cpp.zip

rtek1000 avatar Jun 24 '25 18:06 rtek1000