Mpu9250 interrupt pin



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



  • @dkelly figured it out



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



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