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



  • Hi there

    has anyone else noticed that the three capacitive buttons (below the screen) only work when one holds the Core2 in hand or when it is sitting on a metal surface but not when it is on a wooden table or carpet?

    Note: For me the touch screen works on all surfaces (metal or wood).

    Tested with the factory test application Core2 is preprogrammed with.

    Thanks
    Felix



  • Hmmm, yeah I'm seeing some strange behavior with those 3 touch buttons as well. I just discovered when I have the USB cable plugged in, it works much more consistently on carpet and wood surfaces. When unplugged, it barely works or carpet and wood.



  • Hello @world101

    Thanks for confirming. I just noticed that as well - attaching USB seems to help and makes it work better on non metal surfaces.

    Felix



  • Hi there

    I am playing with some settings in the touch IC, but so far changing touch detect threshold doesn't seem to make any difference - I get the same behaviour on the touch screen (still works) and the cap buttons (don't work) on non metal surface.

    BTW: if I move the Core2 to the edge of my wooden table so that I can touch one screw from below the cap buttons start to work.

    Felix



  • 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)!!



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



  • 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



  • @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).



  • @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?



  • 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



  • @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);
    }