Kabba Posted September 19, 2013 Report Share Posted September 19, 2013 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. Quote Link to comment Share on other sites More sharing options...
Merlin Posted September 21, 2013 Report Share Posted September 21, 2013 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 Quote Link to comment Share on other sites More sharing options...
Kabba Posted October 10, 2013 Author Report Share Posted October 10, 2013 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. Quote Link to comment Share on other sites More sharing options...
gregac Posted March 28, 2014 Report Share Posted March 28, 2014 Hi, I have completely opposite problem. No matter how I set interrupt registers I'm receiving interrupts at 100Hz rate. But what I would need is interrupt only on some motion. Any idea what could it be? Thx. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.