Jump to content
I2Cdevlib Forums

Drotek 10dof v2 MPU6050 making interrupts work


Recommended Posts

Hi all

 

I am trying to get my mpu6050 to generate a motion interrupt. I mainly want my host processor to only start storing data from the mpu6050 when it detects that it has started moving. 

 

To my knowledge I only need to set the correct registers and connect the INT pin to a interrupt port on my host processor. The code is already set up but it does not receive a interrupt.

 

the registers that I have set to enable the motion detection is:

 

INT_PIN_CFG register is set to 0x30

INT_ENABLE register is set to 0x40

 

I left the motion threshold to 0.

 

I would think that this should cause an interrupt on the INT pin, but so far I am not getting anything.

Link to comment
Share on other sites

Hi Newbie

 

Was having a lot of problems getting it to work myself. Problem seems to be the settings. I did finally manage to get it motion detection to work but doesn't really work for constant acceleration. Here is a link to a video I made which has link to the code I used:

.

 

Note: the yellow is Ax and the red is when the motion is detected.

 

Check the settings in the code - took me awhile to find what had to be set. Hope the code helps. If you get it working let me know. - Mike

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...

Sorry for this super late reply. I was caught up with other work for a while.

 

I am a bit confused with the setting of the correct registers. In your code you seem to be setting registers associated with the digital filters. In the documentation I have ( the register map & descriptions) I cannot find the mention of the registers with which I can set the DHPF & DLPF, but I am assuming they are situated at register number 97 and 98.

 

What would the effect be to not set these registers at all? would it make the motion detection not work?

 

So far I have tried to:

 

- set the motion detection threshold register to 0x02

- left the accelerometer start up delay at 4ms

- Enabled the motion detect interrupt

- Then I try to continuously read the Int_status register testing to see if the motion detect interrupt bit gets set to 1 when I move the sensor.

 

So far getting nothing.

 

The documentation I have also doesn't show any registers associated with the DMP, and it seems to me like there are quite a few more settings to be made before interrupts will work. 

 

Does anyone perhaps know the exact steps to go through, and which registers should be set to which values. I feel like the MPU6050 documentation itself leaves much to be desired.

Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...