arduino-esp32 icon indicating copy to clipboard operation
arduino-esp32 copied to clipboard

ESP32-S3 Touch Problem

Open weiwi opened this issue 2 years ago • 6 comments

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

  • [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.

weiwi avatar Sep 20 '23 19:09 weiwi

#include <driver/touch_sensor.h> touch_pad_deinit();

lbernstone avatar Sep 20 '23 23:09 lbernstone

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();
}

weiwi avatar Sep 21 '23 14:09 weiwi

did you solve your problem @weiwi?

VojtechBartoska avatar Oct 04 '23 14:10 VojtechBartoska

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: @.***>

weiwi avatar Oct 04 '23 16:10 weiwi

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

I tried:

  • meas = touch_pad_meas_is_done();
  • status = touch_pad_get_status();
  • touch_pad_clear_status();
  • touch_pad_io_init(TOUCH_PAD_NUM1);
  • touch_pad_io_init(TOUCH_PAD_NUM2);

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:

  • touch_pad_deinit();
  • wait 1-2 seconds
  • touch_pad_init();

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

jdeltoft avatar Mar 10 '24 15:03 jdeltoft

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()

jdeltoft avatar Mar 10 '24 17:03 jdeltoft