Alright so I'm trying to make the MPU 6500 work with interrupt on motion. My issue is that it worked yesterday and today it stopped working. And I'm proper lost as to why. Currently it constantly triggers my interrupt, even if I set the threshold to the highest value (0xFF).
I've setup motion control according to the register map / product specification as supplied by the company that build the sensor.
My relevant code:
#define MPU6500_ADDR 0x68
void MPU6500_Init() {
// Make Sure Accel is running:
I2C1_WriteByte(MPU6500_ADDR, 0x6B, 0x20);
I2C1_WriteByte(MPU6500_ADDR, 0x6C, 0x07);
I2C1_WriteByte(MPU6500_ADDR, 0x1D, 0x01);
I2C1_WriteByte(MPU6500_ADDR, 0x38, 0x40); // Enable Motion Interrupt:
I2C1_WriteByte(MPU6500_ADDR, 0x69, 0xC0); // Enable Accel Hardware Intelligence:
// Set Motion Threshold: 0-255 mg(0 1020)
I2C1_WriteByte(MPU6500_ADDR, 0x1F, 0x20);
// Set wake-up frequency = 0.24Hz ~ 500Hz first 4 bits
I2C1_WriteByte(MPU6500_ADDR, 0x1E, 0x03);
// Enable Cycle Mode (Accel Low Power Mode):
I2C1_WriteByte(MPU6500_ADDR, 0x6B, 0x20);
}
Does anyone have experience with this specific sensor and or can point me into the right direction, becasue I'm lost?