-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32s3 TouchPad not working #13178
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
Has any developer noticed this? I only tested esp32s3 and suspect that s2 also has the same issue, but I don't have the appropriate hardware at hand |
I got same problem. |
I think I got the same problem When I read the value I get nonsensical values like "3252087". Test code:
Version: 1.22.2 |
我给出的帖子里面提到了解决方法,按照做简单修改既可以工作 |
This actually works. Thank you @wangshujun-tj |
I felt like I was chasing my tail with this one since it worked perfectly fine on a WaveShare ESP32-S3-Zero board with the following code: from machine import TouchPad, Pin
import time
t = TouchPad(Pin(1))
while True:
time.sleep(0.5)
print(t.read()) OTOH, on a custom board with a ESP32-S3-MINI-1 module I was seeing static reads from the touch sensor, as other folks report in this issue such as the following (no change at all when touching/not touching):
Then I connected a oscilloscope probe on the CUSTOM boardBaseline (no touch other than the scope probe):Touching with fingers:And then I looked back at the waveforms on the Waveshare boardNo touch (only scope probe attached):Touch:Analysis and workaroundSo there's an obvious electrical difference between touch and no touch on both boards, discarding electrical issues. Then I suspected that the difference on baselines between boards might be the culprit: getting a unstable value as baseline during initialization of the sensor. Then I thought: well, perhaps folks initialize the touch too early before the baseline is relatively stable on custom boards (with more noise and design/manufacturing defects)? That'd also explain the relocation of the Using the following rearrangement of the code (waiting for 10 seconds before importing import time
time.sleep(10)
from machine import TouchPad, Pin
t = TouchPad(Pin(2))
while True:
time.sleep(0.5)
print(t.read()) Makes the touch values finally make sense on the custom board:
So a more robust fix than using hardcoded delays would be for that FSM ( EDIT: Further experimentation suggests that the mechanical configuration of the touch surface does play a big role in determining the baseline on initialization. In my board's case the screws connected to the touch surface were not tight enough and causing false readings across reboots... upon tightening them, all touch false starts disappeared, so YMMV massively here. |
…he 3 touch buttons and then mic... mic task only seems to work when it's the only task spawned (when no touch tasks are spawned)... and in any case, touch reliability seems to be erratic? See micropython/micropython#13178 (comment) /cc @projectgus (do let me know if you need more context and/or a better explanation)
Closes micropython#13178. TouchPad confirmed working on both chips, and fixes the the ESP32-S3 reading constant max value. Was unable to reproduce the bug on ESP32-S2 but this may be due to my test setup, and it still works with the fix. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Closes micropython#13178. TouchPad confirmed working on both chips, and fixes the the ESP32-S3 reading constant max value. Was unable to reproduce the bug on ESP32-S2 but this may be due to my test setup, and it still works with the fix. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
I am doing something like this which works around successfully. Thanks @projectgus hopefully that PR resolves things, this drove me nuts for a while!
|
Closes #13178. TouchPad confirmed working on both chips, and fixes the the ESP32-S3 reading constant max value. Was unable to reproduce the bug on ESP32-S2 but this may be due to my test setup, and it still works with the fix. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Closes micropython#13178. TouchPad confirmed working on both chips, and fixes the the ESP32-S3 reading constant max value. Was unable to reproduce the bug on ESP32-S2 but this may be due to my test setup, and it still works with the fix. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Closes micropython#13178. TouchPad confirmed working on both chips, and fixes the the ESP32-S3 reading constant max value. Was unable to reproduce the bug on ESP32-S2 but this may be due to my test setup, and it still works with the fix. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
The same code changes the number with touch on ESP32, but the reading does not change on ESP32s3
Adjusting the initialization code as follows works fine, but I am not familiar enough with ESP32 and have not fully tested it, for reference only. Additionally, I suspect that the same issue also exists in ESP32s2
The changes are minimal, move the touch_Pad_Fsm_Start to touch_Pad_config After
The text was updated successfully, but these errors were encountered: