espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
12.96k stars 7.29k forks source link

ESP32-S3 Touch Problem #8657

Open weiwi opened 9 months ago

weiwi commented 9 months ago

Board

Qt Py ESP32-S3 AND Seeed XIAOesp32S3

Device Description

Nothing else.

Hardware Configuration

no

Version

latest master (checkout manually)

IDE Name

Arduino IDE

Operating System

Windows 10

Flash frequency

40MHZ

PSRAM enabled

no

Upload speed

115200

Description

I was trying the QT Py ESP32-S3 touch examples and looks like the readings will freeze after the touch pin is grounded and then touched without grounding. I tried both Arduino IDE examples and IDF examples, same problem. Seeed Xiaoesp32S3 has similar problem.

Is there a fix to this? Or is there a way to “reset” the touch function without resetting the whole system, so that the touch function could still be used after ground is detached from touch pin?

I have tried other ESP32 boards(WROOM) and this does not seem to happen.

Sketch

https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Touch

Debug Message

NA

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

lbernstone commented 9 months ago

include <driver/touch_sensor.h>

touch_pad_deinit();

weiwi commented 9 months ago

Thank you for the reply. I tried this, but was not able to initialize the touch function using touch_pad_init(), so touch still does not work after touch_pad_deinit(). Is there anything else needed? Thanks again. @lbernstone @SuGlider

void setup()
{
Serial.begin(115200);
delay(1000); // give me time to bring up serial monitor
Serial.println("ESP32 Touch Test");
}

void loop()
{
touch_pad_init();
Serial.println(touchRead(T1)); // get value using T1
delay(1000);
touch_pad_deinit();
}
VojtechBartoska commented 9 months ago

did you solve your problem @weiwi?

weiwi commented 9 months ago

Not really... any suggestions?

On Wed, Oct 4, 2023, 10:43 AM Vojtěch Bartoška @.***> wrote:

did you solve your problem @weiwi https://github.com/weiwi?

— Reply to this email directly, view it on GitHub https://github.com/espressif/arduino-esp32/issues/8657#issuecomment-1747008366, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA6PWTYPWH4U2GMNCQPGDLX5VYXNAVCNFSM6AAAAAA5AMLOU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBXGAYDQMZWGY . You are receiving this because you were mentioned.Message ID: @.***>

jdeltoft commented 3 months ago

I've been checking if any of the APIs help.

I tried:

When it's working, the get_status works with bit fields for the pins. But when it's stuck those are stuck. And calling io_init or clear_status does not help.

The meas_is_done returns 1 or 0 depending on when it's called, but doesn't give any insight either when stuck

Or doing this if it gets stuck:

I'm not seeing any way to reset just the touch sensor, but will continue digging into the sensor tech docs.

jdeltoft commented 3 months ago

Maybe a slightly different question. I also don't see a great way to know for sure they touch sensor is locked up. Does anyone have a direct way to query this failure state (rather than just trying reads and assuming no movement is "stuck")

The reason I ask is because this reset is very fast and so far fully recovers for me if I have grounded a touch sensor input.

ESP.restart()