Jump to content
I2Cdevlib Forums

InvenSense MotionDriver source code...


Recommended Posts

Apologies for perhaps a strange question, but somebody found something useful from source files of InvenSense (drivers for InvenSense MPL-sensors, MotionApps 5.x.x code, example initialization DMP, example of "auto calibration", etc) for Android Kernel? Look for example on these android Git repositories:
Link 1 and Link 2

 

And some files:
Embedded MotionDriver 5.1
UMPL Source Code
Embedded MotionApps Platform Functional Specification 2.0
MotionDriver Tutorial

 

I look that in different revisions of the source code "InvenSense MotionDriver" observed different size of "DMP Firmware." In some "DMP_CODE_SIZE = 2634", and in other "DMP_CODE_SIZE = 3062" (in MPU memory banks). If I'm right then in the firmware laid some functions and data processing algorithms, which are updated\corrected\complemented with new release of the "InvenSense MotionDriver", and to which access is provided through the "user library". I think that can be quite successfully explore and adapt the available source code in accordance with our needs.
 
Correct me if this is not so.
 
UPDATE:
I also uploaded my simple example, based on "Embedded MotionApps 5.1". It's available at GitHub. This is first release without any optimization. I use "ATmega2560" and MPU-6050(MPU-9150). This code provided "as is". Many functions not tested.
 
UPDATE2:
Added small optimization options for GCC compiler and linker. Also fixed some code for memory optimization.
Link to comment
Share on other sites

I rewrote on whip up (crude method) standard functions from the Arduino libraries for working with I2C interface (twi.cpp, wire.cpp) and a library "I2Cdev" (many thanks to Jeff Rowberg for his invaluable work!) on "pure C" (I do not use Arduino-oriented libraries in my projects). Then, in the same way i adapted the driver source code of "Embedded MotionDriver 5.1" for compile with WinAVR. And it works (look at the picture)! Now i need to clean up the source code (at the moment the code size is greatly inflated), and to understand in detail the interaction of functions with the DMP-kernel.
This is all to the fact that you can quite successfully use the available driver from "Android Kernel". ;)

 

Testing "MotionDriver v5.1" on Atmega2560

post-1231-0-17323000-1389304749_thumb.jpg

Link to comment
Share on other sites

So, I understang you made it work using Android program as reference. In terms of functionality and performance, is there any improvement over I2Cdevlib actual library?  Apart from it being written in "pure C".

 

Would you share it when it's finished?

 

I didn't understand your last message. You are saying that library does the same you just achieved?

 

All this is only for MPU9150 or MPU6050, or both?

 

Sorry for so many questions.... 

Link to comment
Share on other sites

No no no ... When I gave links to the Android repository, I was talking only about the possible usefulness of the source code - fully they are not suitable. As for the "Embedded MotionDriver 5.1", it quite the contrary is suitable for adaptation for the "AVR platform" - in this case you need only include the header files which specific for your compiler or IDE and assigning "read\write" functions of I2С bus. Method of "read\write" data for MPU in this source code is fully compatible with the functions (for ex. "I2Cdev::writeBytes" and "I2Cdev::readBytes") from the library (I2Cdevlib) of  Jeff Rowberg. In addition, in the description of the driver said: this driver currently works for the following devices:
  • MPU6050
  • MPU6500
  • MPU9150 (or MPU6050 w/ AK8975 on the auxiliary bus)
  • MPU9250 (or MPU6500 w/ AK8963 on the auxiliary bus)

About Pansenti's library for MPU-9150. This code fully based on "Embedded MotionDriver 5.x.x" and more adapted to work specifically with MPU-9150, although compatible with the MPU-6050. And also focused on the Arduino platform. So the best solution would be to base the "Embedded MotionDriver 5.xx" and by simple manipulations to adapt it for your project.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks 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...
×
×
  • Create New...