Home > other >  About MPU6050 interrupt response of free fall
About MPU6050 interrupt response of free fall

Time:03-14

The related data, the test code in configuration time is as follows:
Void MPU_Fall_Init (void)//interrupt initialization free fall
{
I2C_Write (MPU6050_RA_FF_THR, 0 x14);//set free fall acceleration threshold of 20 mg
I2C_Write (x0a MPU6050_RA_FF_DUR, 0);//set free fall detection time 10 ms
}

Void MPU_Motion_Init acceleration (void)//interrupt initialization
{
I2C_Write (x4a MPU6050_RA_MOT_THR, 0);//set the acceleration threshold to 74 mg of
I2C_Write (MPU6050_RA_MOT_DUR, 0 x14);//set the acceleration detection time 20 ms
}

Void MPU_Zero_Motion_Init (void)//static interrupt initialization
{
I2C_Write (MPU6050_RA_ZRMOT_THR, 0 x40);//set the acceleration threshold to 64 mg of
I2C_Write (MPU6050_RA_ZRMOT_DUR, 0 x20);//set the static testing time 32 ms
}

In the configuration:
The switch (INT_type)
{
Case 1:
MPU_Fall_Init ();
break;
Case 2:
MPU_Motion_Init ();
break;
Case 3:
MPU_Zero_Motion_Init ();
break;
}
I2C_Write (CONFIG, 0 x06);//configure external pins sampling and DLPF digital low-pass filter
X1c I2C_Write (ACCEL_CONFIG, 0);//acceleration sensor range and high-pass filter configuration
X1c I2C_Write (MPU6050_RA_INT_PIN_CFG, 0);//the INT pin low level usually
I2C_Write (MPU6050_RA_INT_ENABLE, 0 x40);//the interrupt enable register

Here my question is, if in the acceleration mode, can trigger, can not be free fall, static test, another phenomenon is that after May 2, then use 1 is ok, but can't without electricity, no electricity, must from 2 again, this is how to return a responsibility, which set out the problem,

Another no see understand is, for interrupts enabled, three are 0 x40, according to the data, these three should respectively 0 x80/0 x40/0 x20, but Chad's code is 0 x40, there is no reference, it used


thank you
  • Related