MMA8451Q ACC support

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
ronco
Posts: 317
Joined: Thu Aug 18, 2011 2:58 pm

MMA8451Q ACC support

Post by ronco »

Hi,

i did some tests with the MMA8451Q (http://cache.freescale.com/files/sensor ... A8451Q.pdf) it seems to be a good one :)

i did a I2C support code that works .. i dont know if its good .. it may be improved with LPF settings and such stuff..

Code: Select all

// ************************************************************************************************************
// I2C Accelerometer MMA8451Q
// ************************************************************************************************************
#if defined(MMA8451Q)

#define MMA8451Q_ADDRESS 0x1C (standard)
//#define MMA8451Q_ADDRESS 0x1D

void ACC_init () {
  delay(10);
  i2c_writeReg(MMA8451Q_ADDRESS,0x2A,0x05); // wake up & low nois
  delay(10);
  i2c_writeReg(MMA8451Q_ADDRESS,0x0E,0x02); // full scale range
  acc_1G = 512; // should be 1023 but 512 is knowen in MWC
}

void ACC_getADC () {
  TWBR = ((F_CPU / 400000L) - 16) / 2;
  i2c_getSixRawADC(MMA8451Q_ADDRESS,0x00);

  ACC_ORIENTATION( ((rawADC[1]<<8) | rawADC[0])/32 ,
                   ((rawADC[3]<<8) | rawADC[2])/32 ,
                   ((rawADC[5]<<8) | rawADC[4])/32);
  ACC_Common();
}
#endif


//as im on a new PC with win 8 .. i still dont get My SVN clinet to work :(
//so would someone here be so kind to add this support ? :)


Edit:
it workes now .. and i added the support :)

Thanks

regards

Felix
Last edited by ronco on Wed Feb 06, 2013 12:57 pm, edited 1 time in total.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: MMA8451Q ACC support

Post by timecop »

wow, that's pretty awesome! Where'd you find such amazing accel?

ronco
Posts: 317
Joined: Thu Aug 18, 2011 2:58 pm

Re: MMA8451Q ACC support

Post by ronco »

hi,

from freecale :P .. it will be on a new flyduino FC.. we testing the prototypes ATM :)

regrads Felix

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: MMA8451Q ACC support

Post by timecop »

Nice to see Flyduino doing all this innovation!

ronco
Posts: 317
Joined: Thu Aug 18, 2011 2:58 pm

Re: MMA8451Q ACC support

Post by ronco »

.. somehow i cant belive that you mean what you say ;)
but if so .. thanks .. ill try to do my best.

i added the MMA8451Q support now .. and also the defines for the new Flydu Ultra FC :)

regards

Felix

jy0933
Posts: 180
Joined: Wed Jun 27, 2012 4:24 pm

Re: MMA8451Q ACC support

Post by jy0933 »

if you guys dont mind me ask

what is the advantage of this over adxl345 or mpu60xx?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: MMA8451Q ACC support

Post by timecop »

The advantage is flyduino has a lot of these in stock, so they gotta use them for something, hahaha.

ronco
Posts: 317
Joined: Thu Aug 18, 2011 2:58 pm

Re: MMA8451Q ACC support

Post by ronco »

jy0933 wrote:if you guys dont mind me ask

what is the advantage of this over adxl345 or mpu60xx?


hi,

basicly it is just like many other ACC's with a high resolution but it has some extra features that may be helpful .. the problem with MPU6050 only setups is that you can just setup one LPF fore both gyro and ACC ..
so a seperate acc inst that bad if you have space for it :)

regards

felix

jy0933
Posts: 180
Joined: Wed Jun 27, 2012 4:24 pm

Re: MMA8451Q ACC support

Post by jy0933 »

i think current mwc code only has gyro_lpf for setup for now.... the acc still under the LPF_factor thing..not a stand alone(user adjustable ) lpf

but yeah.. will be pretty interesting to see how a separate lpf works out.... (personally i think the separate acc lpf might help with alt maintain on Z axis readings)

Post Reply