Ferrocen Posted January 3, 2014 Report Share Posted January 3, 2014 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.1UMPL Source CodeEmbedded MotionApps Platform Functional Specification 2.0MotionDriver 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. Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted January 9, 2014 Report Share Posted January 9, 2014 If I am not mistaken, what you want to do is to use I2Cdevlib library, maybe update/complete it with things found in those file and use it on Android?? Or are you suggeting that we should take a look at Android's code in order to improve I2Cdevlib library for microcontrollers? I'm confused.... Quote Link to comment Share on other sites More sharing options...
Ferrocen Posted January 9, 2014 Author Report Share Posted January 9, 2014 You're right in the second case. Quote Link to comment Share on other sites More sharing options...
Ferrocen Posted January 9, 2014 Author Report Share Posted January 9, 2014 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 Quote Link to comment Share on other sites More sharing options...
Ferrocen Posted January 10, 2014 Author Report Share Posted January 10, 2014 As was mentioned earlier by Jeff Rowberg turnkey solution for platform Arduino, based on "Embedded Motion Driver v5.1.1 SDK", located on the Pansenti GitHub MPU9150Lib. It has some simple sketches showing how the software can be used and also to calibrate the accelerometers and magnetometer (if it is connected). Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted January 14, 2014 Report Share Posted January 14, 2014 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.... Quote Link to comment Share on other sites More sharing options...
Ferrocen Posted January 14, 2014 Author Report Share Posted January 14, 2014 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. Quote Link to comment Share on other sites More sharing options...
luisrodenas Posted January 15, 2014 Report Share Posted January 15, 2014 Thanks for the explanation. I think I got it now. Just two more questions: -what is the advantage of using MotionDriver 5.x.x vs older MotionDriver versions? - is this file "MPU6050_6Axis_MotionApps20.h" based on MotionDriver v2.0 or they are different things? Quote Link to comment Share on other sites More sharing options...
Ferrocen Posted January 24, 2014 Author Report Share Posted January 24, 2014 I don't have any info about "Embedded MotionApps Platform Release 2.0.0". It's currently unavailable for downloading. I have nothing to compare the latest version available. I think it is more correct to use the latest version. Please pay attention to the achievements of Pansenti GitHub MPU9150Lib. Quote Link to comment Share on other sites More sharing options...
Ferrocen Posted January 24, 2014 Author Report Share Posted January 24, 2014 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.Good luck! Quote Link to comment Share on other sites More sharing options...
Ferrocen Posted February 1, 2014 Author Report Share Posted February 1, 2014 Small update: added one of several flight devices such as Attitude Indicator for data visualization. Quote Link to comment Share on other sites More sharing options...
Ferrocen Posted February 2, 2014 Author Report Share Posted February 2, 2014 New small update: added a "Directional Gyro" device.NOTE: This source code does not contain any filters prevent drift from y-axis (YAW). 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.