code_glitch Posted July 5, 2014 Report Share Posted July 5, 2014 Hey there - I've been using the I2CDevlib MPU6050 code for about 18 months in the development of a new flight control system (I know what some of you are thinking - oh god ANOTHE flight control thingy...) Anyways, in optimizaing the code, I've found that the MPU6050 type is munching ~1200 bytes of RAM Which on a standard ATMega328 is almost 60% of all its RAM. The older flight computers used a cluster configuration that talked over I2C so we could just dump the mpu handling code in there and have the other ATMegas do the reast. This isn't ideal since its unreliable, bulky (and so on). I had a skim of the source and not found anything that my reasonably poor C skills can pick out as a stick out memory hog. So in short - is there anything that I can remove from the MPU6050 class to make it use less memory? The only data I am interested in is roll, pitch, yaw angles as well as accleration on the X, Y & Z axes. However if it would save a reasonable amount of memory, the acceleration data could be replaced by using data from other sensors onboard the aircraft. Cheers, code (and sorry if this first post isn't in quite the same style as other posts, do feel free to edit and whatnot). Quote Link to comment Share on other sites More sharing options...
bycko Posted July 12, 2014 Report Share Posted July 12, 2014 I am having the same issue, except the sketch takes up 72% on my Arduino Yun. I have sent Jeff a PM. Hopefully he replies soon and I will share with you what his response is. Quote Link to comment Share on other sites More sharing options...
code_glitch Posted July 13, 2014 Author Report Share Posted July 13, 2014 Cheers for that. My current 'solution' has been to bump of all the code onto a 2nd ATMega and then network them over I2C as that ironically works out with much lower resource usage on the main ATMega. Though it would still be really nice to not have to jump through so many hoops. 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.