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

    Unable to wake M5StickC using SH200Q's activity interrupt

    Scheduled Pinned Locked Moved M5 Stick/StickC
    4 Posts 3 Posters 9.1k Views 1 Watching
    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.
    • M Offline
      marsalkm
      last edited by marsalkm

      According to some of the documentation (and a random issue on GitHub), the SH200Q should be hooked up to GPIO35 to wake the stick from deep sleep upon activity. While running, I can see this interrupt being triggered, but it never actually wakes from deep sleep.

      Here's the code I use to set up the interrupt:

      // Enable acc interrupt
        buf = 1<<1;
        M5.IMU.I2C_Write_NBytes(SH200I_ADDRESS, 0x14, 1, &buf);
      
        // Set acc threshold
        buf = 100;
        M5.IMU.I2C_Write_NBytes(SH200I_ADDRESS, 0x17, 1, &buf);
        
        // Set amount of time acc must be in threshold before interrupt is triggered
        buf = 4;
        M5.IMU.I2C_Write_NBytes(SH200I_ADDRESS, 0x19, 1, &buf);
      
        // set gyro x/y/z as inputs for interrupt (bit 7 enables the use of TIME_THRESHOLD)
        buf = 1<<4 | 1<<5 | 1<<6 | 1<<7;
        M5.IMU.I2C_Write_NBytes(SH200I_ADDRESS, 0x1B, 1, &buf);
      

      And this is the line that should enable wake on GPIO35 activity:
      esp_sleep_enable_ext0_wakeup((gpio_num_t)35, 1); // set ext0 to wake up when GPIO35 is high

      I've also tried enabling wakeup on one of the external M5Stick buttons as a sanity check.. that worked fine.

      My question; is the SH200Q's interrupt actually hooked up to anything, and if so what? Or is there some error in my code?

      1 Reply Last reply Reply Quote 1
      • V Offline
        vany5921
        last edited by

        IMU does not control GPIO35 to issue an interrupt

        1 Reply Last reply Reply Quote 1
        • D Offline
          davesee
          last edited by

          Should this work when using the M5StickC model with the MPU6886 IMU?

          The schematic suggests that GPIO35 is wired to the external interrupt of the MPU6886 https://docs.m5stack.com/#/en/core/m5stickc

          Cheers,
          Dave

          1 Reply Last reply Reply Quote 0
          • D Offline
            davesee
            last edited by

            @marsalkm This ability should work on M5StickC units with the MPU6886. There's more info on this thread here:
            https://community.m5stack.com/topic/2039/wake-up-on-pick-up

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post