MMA8453Q Self Test

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MMA8453Q Self Test

722 Views
GordyCarlson
NXP Employee
NXP Employee

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

Labels (1)
Tags (3)
0 Kudos
1 Reply

441 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Gordy,

Sorry for the late response, I have been out of the office the last couple of days.

First, to activate the self test by setting the ST bit in the CTRL_REG2 register (0x2B), the MMA8453Q must first be put into Standby mode by clearing the ACTIVE bit in the CTRL_REG1 register (0x2A). Then you can set the ST bit in the CTRL_REG2 register and put the part back into the Active mode by setting the ACTIVE bit in the CTRL_REG1 register:

void accSelfTest(void)

{

    uint8_t reg;

    accelRegRead(CTRL_REG1, &reg);

    accelRegWrite(CTRL_REG1, reg & 0xFE);        // Standby mode

    accelRegRead(CTRL_REG2, &reg);

    accelRegWrite(CTRL_REG2, reg | ST);

    accelRegWrite(CTRL_REG1, reg | 0x01);        // Active mode

  

    delay(2);

    accelRegWrite(CTRL_REG2, reg);

}

Further, the transient detection function uses the high-pass filtered data unless the HPF_BYP bit in the TRANSIENT_CFG register (0x1D) is set. So, I would recommend to set this bit or use the motion detection function.

I hope it helps.

Regards,

Tomas

0 Kudos