-
Notifications
You must be signed in to change notification settings - Fork 7.6k
touchAttachInterrupt takes 25ms for each pin!!! #7097
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
Comments
@AKTanara - You are measuring how long does it take to execute It is done once, usually in |
The time it takes to execute What exactly is the issue that you are describing? |
@SuGlider - First of all thanks for your reply,
Yep, I'm well aware of that...
Actually for the best touch response I was updating the thresholds of touch triggers continuously. So yes it is an issue for my application. Besides I find it fairly unusual for such a simple task on a 240MHz processor to take 25ms per pin! while it wasn't even taking 1ms in previous versions. So I am confident to say it is a bug. |
@AKTanara - Thanks for the clarification.
ESP32-S2 and ESP32-S3 have a way better Touch hardware that uses another IDF code for this peripheral. I just tested the sketch of this issue with ESP32-S3 and Arduino Core 2.0.4. Using GPIO 4 also (Touch 4 of ESP32-S3) output of S3:
|
For the ESP32 chip, indeed there is the issue of 25~27ms per execution of We can check the code and verify if we can improve it. |
The issue with ESP32 is here: It takes the 25ms. If the sktech changes the Threshold all the time, this will be a problem with IDF in Core 2.0.2+, when we moved it to IDF, making it different from Core 1.0.6 version. |
For the ESP32 there is no other way to change the Threshold using just IDF touch driver calls... We can try to use HAL level calls .... @P-R-O-C-H-Y - Please investigate if we can just use |
@AKTanara - Maybe we can fix it to behave the same way as in 1.0.6... let's see. |
with the PR the ESP32 output is:
|
@SuGlider - With this thorough investigation you left me speechless and yet you are thanking me?! At best I was hoping for just a confirmation of the issue within a week and now in less than few hours (actually few minutes, cuz most of the delay was from my side), I have a solution for the current situation and a promising answer for a future S3 concern. It was very kind of you testing on ESP32-S3. I'm deeply appreciative. |
Board
ESP32-WROOM-32E (4MB Flash)
Device Description
Nothing
Hardware Configuration
Using On both WROOM Tester and on PCB
Version
v2.0.4
IDE Name
Arduino IDE 1.8.19
Operating System
Windows 10
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
I was using ESP32 Arduino v1.0.6 to program ESP32-WROOM-32E (4MB Flash) and had no issue whatsoever. Since I upgraded to ESP32 Arduino v2.0.4 I noticed lags in hardware response. Tracking down I reached some strange difference between two versions. touchAttachInterrupt that took less than 1ms in v1.0.6 now takes 26ms!
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: