stampS3 capacitive touch detect : GPIO#3 NOT working??



  • Now making a tool with 12 capacitive touch sensors using stampS3 on Arduino.
    I am confusing why touch detect does not work well when using GPIO#3pin.
    I have confirmed that pin define WITHOUT GPIO#3pin , it works well.
    I have confirmed that both of my two stampS3 show the same result with nothing connected to stampS3.

    I may not understand well of official documents, can you tell me where to read?

    quotation of my Arduino program
    ........
    #define numSW 12 //define number of touch SWs
    int TOUCH_PIN[numSW] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13 }; //define GPIO number for.each touchSW
    .....
    void serialPrintThresh() { //読み取り値と閾値を列記
    for (int touchNum = 0; touchNum < numSW; touchNum++) {
    USBSerial.print(touchNum + 1); //+1してピン番号に換算
    USBSerial.print(": ");
    USBSerial.print(touchRead(TOUCH_PIN[touchNum]));
    USBSerial.print(" / ");
    USBSerial.print(threshold[touchNum]);
    USBSerial.println(" ");
    }
    }

    ......serial print result:
    ......many GPIO pins show big number, not only #3
    ......only #1 pin can detect touch well, BUT others can not !

    1: 13859 / 2764
    2: 13998 / 2799
    3: 2443023 / 488604
    4: 2783227 / 556645
    5: 4178149 / 835629
    6: 1179519 / 235903
    7: 4060029 / 812005
    8: 1920687 / 384137
    9: 4003023 / 800604
    10: 893757 / 178751
    11: 3026140 / 605228
    12: 3399653 / 679930

    _____________modified program, exchange #3 to #12

    int TOUCH_PIN[numSW] = { 1, 2, 12, 4, 5, 6, 7, 8, 9, 10, 11, 13 }; //define GPIO number for.each touchSW
    ..........all pins shows similar number
    ..........each pin detect touch well !

    1: 13840 / 2758
    2: 13982 / 2796
    3: 13921 / 2770 // #12GPIO pin
    4: 13443 / 2680
    5: 12204 / 2434
    6: 12192 / 2427
    7: 12522 / 2495
    8: 11920 / 2377
    9: 12530 / 2501
    10: 12662 / 2533
    11: 20303 / 4060
    12: 13899 / 2779



  • Hello @sunshine

    GPIO0, GPIO3, GPIO45 and GPIO46 are so called strapping pins which are used to setup various things at boot time.

    In the M5StampS3 schematic you'll see that an external 10 k pull-up resistor has been connected to GPIO3. I guess that's the reason for the values you are getting.

    Thanks
    Felix



  • @felmue
    Thank you for your prompt reply.
    On the same document showing pin assignment of stampS3, I thought that G3 can be used for TCH3 same as others.
    But I understand that G3 can not be used for touch detect as others.
    And, other touch pins do not work as touch pins affected by G3 pin assignment for touch, is more serious issue for me.
    If you know, can I use with some special treatment for G3 ? eg. it can be used as touch detect after certain time passed after boot time?



  • Hello @sunshine

    I don't know if G3 could be used a touch detect with the pull-up in place. Sorry.

    Thanks
    Felix



  • @felmue
    thanks!
    I will change my PCB design not to use GPIO#3 for capacitive touch detect.