Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
regystro opened this issue Apr 11, 2024 · 5 comments
Assignees
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@regystro
Copy link

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.

@rzeldent
Copy link
Owner

rzeldent commented Apr 11, 2024

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

@regystro
Copy link
Author

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.

@rzeldent
Copy link
Owner

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 rzeldent self-assigned this Apr 16, 2024
@rzeldent rzeldent added help wanted Extra attention is needed question Further information is requested labels Apr 16, 2024
@regystro
Copy link
Author

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: esphome/issues#5708

@rzeldent
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants