Jump to content
I2Cdevlib Forums

What registers should be written first in mpu6050 to read the data of gyro registers


Recommended Posts

I have mpu6050 interfaced to 8051 micro-controller. I am using this to balance my quadcopter. I googled very much but I did not find how to get value of gyro or accel, every where i found is that it was interfaced to Audrino. When I try to get the WHO_AM_I address values I get them successfully, but when I try to get the gyro values from register 0x43h it shows constantly varying values and are completely random, that is they are not rounding around any value. My question is that is there any initialization required to start getting correct value from gyro? Do I need to write some registers first so that then I could get the gyro values correctly?

Link to comment
Share on other sites

  • 3 weeks later...

I think you may need to activate some of the more advanced functionality of the MPU or the DMP. Off the top of my head, here's what I'd recommend trying:

 

First, try enabling the low-pass filter. I'm not 100% sure this is the trick, but LPFs are used to reduce noise, so it sounds plausible. PS: I've heard that this function MUST be called last, due to a bug in the API, but Im not sure.

 

If that doesn't help, try retrieving the data from the DMP FIFO, after it's been processed by the DMP. This is not the most straightforward process, but it can be done, and once it's working, you'll get useable data without burning up your microcontroller's CPU. 

 

Another note, there are lots of undocumented bugs and typos scattered across all the revisions of Invensense's drivers. I've had the best luck with 6.12, but that's not saying much, and luck is a key word. 

 

Good luck!

 

-Matt

Link to comment
Share on other sites

Oh! I just thought of one more possibility: Make sure you're interpreting those values as SIGNED numbers. If you treat them as unsigned, you'll see values of  4,294,967,295 "jump" to 0... the last bit is reserved for positive/negative, so the 2 values are actually -1 and 0.

Link to comment
Share on other sites

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...