MPU6050 waiting for interrupt


Thanks to Jeff for his work ! I couldn't even try using DMP without his code...

The MPU6050_raw works well with my sparkfun mpu6050 connected to an arduino uno. The MPU6050_DMP6 has an irregular behavior. When launching, the serial monitor says "DMP ready! Waiting for first interrupt...", and indeed it waits a pretty long time... The interrupt pin is connected to arduino pin 2 I've also tried to connect the vio to arduino 3.3v The point is that I've no interrupt signal when connecting an oscilloscope on INT pin of the mpu... is there a hardware issue ? or should I initialize something in the mpu ?

Thanks for your response

I have worked over this code and resolved several issues that appeared as i developed my balancing robot
Balancing Bot MPU6050 and Arduino UNO
The below code is the portion of code relating only to the MPU6050. It uses Digital Motion Processor( DMP ) of the MPI6050 and the FIFO buffer with the interrupt on Pin 2. it handles errors easily and can display the cause of the error when they occur

I also provide instructions in the code on how to calibrate the MPU6050

MPU6050_Test_Code.ino (9.57 KB)

When INT is open drain, a pullup resistor is required.

DrDiettrich: When INT is open drain, a pullup resistor is required.

No luck with that either unfortunately. The interrupt is meant to be checking for a rising edge, do you pull down then?

I'm not sure what you mean. When the INT output can drive the line only LOW, there must exist another component to pull it HIGH.

When the interrupt occurs (condition met), the INT line is driven LOW. I.e. the input pin must be watched for a falling edge, or low level.

Great Observation it could go either way so I checked it out and found this

DrDiettrich: When INT is open drain, a pullup resistor is required.

in the MPU6050 MPU-6000/MPU-6050 Register Map and Descriptions document Page 26 Register 55 – INT Pin / Bypass Enable Configuration Bit6: INT_OPEN When this bit is equal to 0, the INT pin is configured as push-pull. When this bit is equal to 1, the INT pin is configured as open drain

in MPU6050.cpp on line 1386 we find this function and we can check for this

/** Get interrupt drive mode.
 * Will be set 0 for push-pull, 1 for open-drain.
 * @return Current interrupt drive mode (0=push-pull, 1=open-drain)
 * @see MPU6050_RA_INT_PIN_CFG
bool MPU6050::getInterruptDrive() {
    I2Cdev::readBit(devAddr, MPU6050_RA_INT_PIN_CFG, MPU6050_INTCFG_INT_OPEN_BIT, buffer);
    return buffer[0];

added this code to discover what the register contains

  Serial.print("mpu.getInterruptDrive=  ");Serial.println(mpu.getInterruptDrive());

it returns 0 or in other words INT pin is configured as push-pull. Conclusion: NO pull up resister is required.

If you still don't see an interrupt signal on your scope, you may have to also configure the pin for the desired (type of) interrupt, or whatever settings are required to make the sensor run.

Yes the MPU6050 needs to have the interrupt enabled.
I was assuming you are going to use the MPU6050 test code for this evaluation. I posted the earlier. with that specific code the mpu6050 does not require a pull up resister and the code enables the interrupt registers.
if you are using some other code you may need to look over the MPU-6000/MPU-6050 Register Map and Descriptions document and determine what you want to have trigger the interrupt and enable it.

MPU6050 documentation

The MPU6050.h MPU6050.cpp is has all the registers broken out for easy access