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

    Mpu9250 interrupt pin

    M5stack Grey
    2
    4
    9.0k
    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.
    • D
      dkelly
      last edited by

      What pin of the esp32 is the mpu9250 interrupt pin connected to? I’m using a different mpu9250 library and want to leverage interrupts.

      Is there a m5stack gray pinout diagram somewhere? I only see a pinout for the core unit, and the mpu9250 is not shown on it.

      Thanks!

      D 1 Reply Last reply Reply Quote 0
      • D
        dkelly @dkelly
        last edited by

        @dkelly figured it out

        1 Reply Last reply Reply Quote 0
        • D
          dda
          last edited by

          It should be 34. From MPU9250.cpp:

          // Configure Interrupts and Bypass Enable
          // Set interrupt pin active high, push-pull, hold interrupt pin level HIGH until interrupt cleared,
          // clear on read of INT_STATUS, and enable I2C_BYPASS_EN so additional chips
          // can join the I2C bus and all can be controlled by the Arduino as master
          writeByte(MPU9250_ADDRESS, INT_PIN_CFG, 0x22);
          writeByte(MPU9250_ADDRESS, INT_ENABLE, 0x01); // Enable data ready (bit 0) interrupt
          delay(100);
          

          0x22 = 34.

          D 1 Reply Last reply Reply Quote 0
          • D
            dkelly @dda
            last edited by

            @dda Thanks, I had tried 34 in the other Library and it wouldn’t work. But when I inserted the writeByte lines just as you showed, it worked. But i’m still having issues running my IMU via interrupt vs just times (like a fixed 1KHz). The timed approach always works, but the interrupt approach will crash sometimes or lock up. So something still seems off with the m5stack and the MPU9250. Also the magnetometer doesn’t seem to function properly on the m5stack for me, even after the battery pack with magnets is removed.

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