AnsweredAssumed Answered

MMA8451Q Z-axis issues

Question asked by Petr Kubiznak on Dec 11, 2013
Latest reply on Jun 8, 2015 by Jiri Bartos

Hi everyone,

we are experiencing difficulties with the Z-axis of the MMA8451Q accelerometer. Running the (slightly modified) MQX's accelerometer demo on two devices, each accelerometer behaves differently and neither of them seems to work correctly.

 

Firstly the sensor is initialized with the following (unchanged) code:

/* Configure MMA8451Q */

  data[0] = 0x11;

    data[1] = 0xc0;

    mcI2C_write(I2C_ACCELEROMETER_BUS, I2C_ACCELEROMETER_ADDRESS, data, 2);

 

    data[0] = 0x2a;

    data[1] = 0x04 | 0x01;

    mcI2C_write(I2C_ACCELEROMETER_BUS, I2C_ACCELEROMETER_ADDRESS, data, 2);

It simply enables the orientation detection and activates the sensor. The rest is left untouched with the default values.

 

On the first device, the Z-axis does not seem to work at all, outputting always 0x8000. The orientation status does not change when flipping the device (see attached accel1.txt).

 

On the second device, the Z-axis output value also stagnates, but on a different value: 0xF5XX, i.e. the MSB part does not change, but the LSB part changes (see attached accel2.txt). But here, even though the value does not behave as expected, the orientation status changes correctly. And MSB sometimes (but rarely) also changes - just for one readout, even without the need to move the device (and the value change might be large, i.e. in tens). The attachment shows one such "flash", which was in this case caused by a short quick move (see the orientation status also changed). But as I say, these rare flashes appear randomly and are not conditioned by any movements performed.

 

Does anyone have an explanation for such behaviour? Might the first piece be connected to this announcement: http://www.freescale.com/files/shared/doc/pcn/PCN14989.htm ? And why the second gives unchanging values if it detects the orientation correctly?

Original Attachment has been moved to: accel1.txt.zip

Original Attachment has been moved to: accel2.txt.zip

Outcomes