AnsweredAssumed Answered

MMA8453Q Self Test

Question asked by Gordy Carlson Employee on Dec 11, 2013
Latest reply on Dec 16, 2013 by Tomas Vaverka

Thanks in advance for your patience, we are relative newbies in using this part....

 

This device has a self test feature that introduces a noise spike in the data that simulates movement on each of the XYZ axis. My customer would like to use this feature to final test their end product on their manufacturing line without having to build a mechanical tilt+bump test platform.

 

  We enable "Self Test" in the config register, but are having difficulty getting the unit to recognize this function and generate an interrupt to an external MCU. When we mechanically bump the unit, an interrupt is generated as desired, so we believe we have the back end (digital+interrupts) enabled and functioning properly.

 

  I checked the data sheet and found that the generated Self Test noise values in 4g mode are X=11 LSB, Y=16 LSB, and Z = 105 LSB.   I then asked the customer to double check his noise thresholds and sampling delay to see if somehow they were set too high to be triggered by the small self test noise event.

 

His response ......

--------------------------------------------------------

Below is the code I use to try the self test. The delay is approximately 25ms. ST is 0x80.  I am using the default range of 2g. Even when setting the wakeup threshold to the minimum of 1 and it wakes up with a bare touch, the self-test does not wake it up. The wakeup interrupt I have enabled is the "transient" interrupt for all 3 axis' which works very well for real bumps. Is there anything else I need to set up? I know the register read and write routines work since I use them to set things up on startup and also for clearing the interrupt. I have a scope on the interrupt line and a breakpoint on the service routine that clears the interrupt. Everything runs at 3.3V.

 

 

void accSelfTest(void)

{

    uint8_t reg;

 

    accelRegRead(CTRL_REG2, &reg);

    accelRegWrite(CTRL_REG2, reg | ST);

    delay(2);

    accelRegWrite(CTRL_REG2, reg);

}

---------------------------------

 

 

Any clues on where to focus our debugging efforts and attention are appreciated.

 

-Gordy

 

 

Outcomes