🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Capacitive buttons only work when holding Core2 or when sitting on metal surface

    Core 2
    5
    15
    20.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      veryalien
      last edited by veryalien

      I agree with the comments that the buttons are much more reliable when holding the core2, only touching the white plastic at the same time as a button is enough, no metal parts need to be touched.
      Edit: The following was with manually changed uiflow/micropython code btna, b, or c.isPressed()
      I also noticed that you can only touch one button at a time, which means some older multi-button apps won't work any more. When you press A (left) and C (right) at the same time, you actually get B (centre)!!

      1 Reply Last reply Reply Quote 0
      • RopR
        Rop
        last edited by

        Hmm, I see none of the effects described here. My touch screen seems to work fine, with cable plugged and unplugged.

        world101W 1 Reply Last reply Reply Quote 0
        • felmueF
          felmue
          last edited by

          Hi guys

          interesting. I wonder if we're dealing with different touch firmware versions? Here is the readout of my Core2 touch (read only registers):

          LIB_VER_H (0xA1) : 0x30
          LIB_VER_L (0xA2) : 0x0E
          CIPHER (0xA3) : 0x64
          FIRMID (0xA6) : 0x10
          FOCALTECH_ID (0xA8) : 0x11
          RELEASE_CODE_ID (0xAF) : 0x01

          Thanks
          Felix

          GPIO translation table M5Stack / M5Core2
          Information about various M5Stack products.
          Code examples

          world101W 1 Reply Last reply Reply Quote 0
          • world101W
            world101 @Rop
            last edited by world101

            @rop said in Capacitive buttons only work when holding Core2 or when sitting on metal surface:

            Hmm, I see none of the effects described here. My touch screen seems to work fine, with cable plugged and unplugged.

            You're lucky! The backlit area of touch screen is fine. It's the capacitive buttons (part of the touch screen glass, but below the actual IPS LCD screen) that have the issue for me. Please confirm if the capacitive buttons work for you in the scenarios described above (non-conductive surfaces).

            RopR 1 Reply Last reply Reply Quote 0
            • world101W
              world101 @felmue
              last edited by

              @felmue

              I'm using uiFlow firmware Beta2-core2 as listed in the M5-Burner app.
              How can I read the registers to obtain the values?

              1 Reply Last reply Reply Quote 0
              • felmueF
                felmue
                last edited by felmue

                Hi @world101

                please try below python code (sorry no Blockly as I couldn't figure out how to convert values to hex in Blockly).
                You'll need to have your Core2 connected to your computer and open the COM Monitor in M5Burner to see the output.

                from m5stack import *
                from m5stack_ui import *
                from uiflow import *
                import i2c_bus
                
                screen = M5Screen()
                screen.clean_screen()
                screen.set_screen_bg_color(0xFFFFFF)
                
                i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x38, freq=400000)
                
                print("LIB_VER_H (0xA1) : ", hex(i2c0.read_u8(0xA1)))
                print("LIB_VER_L (0xA2) : ", hex(i2c0.read_u8(0xA2)))
                print("CIPHER (0xA3) : ", hex(i2c0.read_u8(0xA3)))
                print("FIRMID (0xA6) : ", hex(i2c0.read_u8(0xA6)))
                print("FOCALTECH_ID (0xA8) : ", hex(i2c0.read_u8(0xA8)))
                print("RELEASE_CODE_ID (0xAF) : ", hex(i2c0.read_u8(0xAF)))
                

                Cheers
                Felix

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

                1 Reply Last reply Reply Quote 0
                • RopR
                  Rop @world101
                  last edited by Rop

                  @world101

                  Please confirm if the capacitive buttons work for you in the scenarios described
                  above (non-conductive surfaces).

                  OK, I see what you mean now. I hadn't tested the buttons below the screen without the USB cable. Seems like a grounding issue of sorts: the display area probably has a metal base plate.

                  Bummer, makes the buttons less usable.

                  I used my own library fork to test, and the following code, which simply puts a white rectangle 40 pixels above a pressed off-screen button.

                  #include <M5Core2.h>
                  
                  void setup() {
                    M5.begin();
                    M5.BtnA.fnPress = M5.BtnA.fnRelease = btnHandler;
                    M5.BtnB.fnPress = M5.BtnB.fnRelease = btnHandler;
                    M5.BtnC.fnPress = M5.BtnC.fnRelease = btnHandler;
                  }
                  
                  void loop() {
                    M5.update();
                  }
                  
                  void btnHandler(TouchButton &btn) {
                    M5.Lcd.fillRect(btn.x0, btn.y0 - 40, btn.x1 - btn.x0, btn.y1 - btn.y0, btn.isPressed() ? WHITE : BLACK);
                  }
                  
                  1 Reply Last reply Reply Quote 0
                  • felmueF
                    felmue
                    last edited by

                    Hi guys

                    today I've opened my M5Core2 and tried to improve the responsiveness of the three capacitive buttons below the screen by adding some grounded copper below. It helped but unfortunately it's still not perfect.

                    https://www.gwendesign.ch/kb/m5stack/m5core2/#capacitive-touch-button-improvement

                    Happy Stacking!
                    Felix

                    GPIO translation table M5Stack / M5Core2
                    Information about various M5Stack products.
                    Code examples

                    1 Reply Last reply Reply Quote 0
                    • S
                      sheepDog
                      last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • RopR
                        Rop
                        last edited by

                        Found an undocumented register on the FT6336 touch chip: reg 0x82 is touch sensitivity. Default set to 15 (0x0F). Setting it to 1 makes it see your finger before it touches, setting it to 127 makes it really hard to get it to detect unless you really push. To play with it with my library: M5.Touch.ft6336(0x82, 13); to set it to 13. Also M5.Touch.dump() shows all the registers.

                        Was hoping a lower setting would make it see the area under the circles better. But no luck, even at one that pretty much the same behaviour. The default seems well-chosen: I see no benefits to changing it either way.

                        1 Reply Last reply Reply Quote 0
                        • felmueF
                          felmue
                          last edited by

                          Hi @Rop

                          I think I've played with that register setting myself at one point in the past and I also did not see any difference in regard of the area under the circles. It will be interesting to see if that will be improved in one of the next M5Core2 hardware revisions.

                          Thanks
                          Felix

                          GPIO translation table M5Stack / M5Core2
                          Information about various M5Stack products.
                          Code examples

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post