Navigation

    LILYGO

    • Register
    • Login
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Problem waking up from IMU interrupt on T-PCIE

    Common problems
    1
    1
    95
    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.
    • A
      aseton last edited by

      Hi,

      I have a T-PCIE v1.2 (WROVER-E) and an MPU 6050 IMU with INT connected to GPIO 36 on the T-PCIE. I am trying to make the IMU wake up a sleeping MCU when motion is detected on the IMU. My problem is that the MCU is immediately woken up after going to sleep with wake reason ESP_SLEEP_WAKEUP_EXT0. I have seen this issue reported before on other ESP32 variants, but no actual soluations. Anyone here has experience with waking up MCU from motion detection or specifically using EXT0?

      My setup and sleep code is as follows:

      // Motion detection setup
      mpu.setHighPassFilter(MPU6050_HIGHPASS_0_63_HZ);
      mpu.setMotionDetectionThreshold(10);
      mpu.setMotionDetectionDuration(20);
      mpu.setInterruptPinLatch(true);	// Keep it latched.  Will turn off when reinitialized.
      mpu.setInterruptPinPolarity(true);
      mpu.setMotionInterrupt(true);
      
      // ...
      
      // Go to sleep if running time is up
      if (millis() > TIME_TO_RUN * MS_TO_S_FACTOR)
      {
        Serial.println("Going to sleep.");
      
        // Configure PIN 36 for INT input
        pinMode(GPIO_NUM_36, INPUT);
      
        //esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * US_TO_S_FACTOR);;
        if (esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW) != ESP_OK)
        {
            Serialprintln("Error enabling interrupt wakeup!");
        }
        esp_deep_sleep_start();
      }
      

      Thanks!

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB | Contributors