This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

On the mpu6050 module, the configuration Data y Ready interrupt is not successful

NRF52832 S132 MPU6050 TWI
I want to finish the function:
1. When the ACC, GYRO data update, the INT pin to generate an interrupt, and then in the P026 pin configuration falling edge trigger GPIOTE interrupt,and then read the ACC, GYRO data in the interrupt function.
I have now verified the following results:
1.Finished this function by pressing the S1 button, i can read the ACC data through GPIOTE
2.The ACC data is changed by the ACC data printed by the UART.If the MPU6050 interrupt configuration is successful, it should be in the INT to generate an interrupt signal.
Problem;
When the ACC data is updated and successfully written to its corresponding register, why is there no interrupt on the INT pin?

The code is as follows: bool mpu6050_init(uint8_t device_address) {
bool transfer_succeeded = true; uint8_t res;

  m_device_address = (uint8_t)(device_address << 1);

  mpu6050_register_write(MPU_PWR_MGMT1_REG , 0x80);  

//#define MPU_PWR_MGMT1_REG 0X6B nrf_delay_ms(1000);
mpu6050_register_write(MPU_PWR_MGMT1_REG,0x01);

  mpu6050_register_write(MPU_GYRO_CFG_REG , 0x18);

//#define MPU_GYRO_CFG_REG 0X1B mpu6050_register_write(MPU_ACCEL_CFG_REG,0x00);
//#define MPU_ACCEL_CFG_REG 0X1C
mpu6050_register_write(MPU_SAMPLE_RATE_REG , 0x04); //#define MPU_SAMPLE_RATE_REG 0X19 mpu6050_register_write(MPU_CFG_REG , 0x03); //MPU_CFG_REG 0x1A

      mpu6050_register_write(MPU_INT_EN_REG,MPU_DATA_RDY_EN_INT);	

//#define MPU_INT_EN_REG 0X38 //#define MPU_DATA_RDY_EN_INT 0X01 mpu6050_register_write(MPU_USER_CTRL_REG,0X00); //#define MPU_USER_CTRL_REG 0X6A mpu6050_register_write(MPU_INTBP_CFG_REG,0X30); //#define MPU_INTBP_CFG_REG 0X37

return transfer_succeeded;

}

Related