AnsweredAssumed Answered

FXOS8700CQ Motion Detection and Interrupts

Question asked by Alejandro Velez on Oct 27, 2015
Latest reply on Nov 16, 2015 by Anthony Duhamel

Greetings,

 

I'm trying to configure the FXOS8700CQ sensor with motion detection and interrupt in one of the two interrupt pins. So far I tried to do an example from the application note AN4070 made for a MMA8451 Sensor changing the register number for the FXOS8700CQ ones, but I still don't get the interrupt.

 

I follow the steps:

 

Example Steps for Configuring Motion Detection

 

X or Y > 3g using MFF Function 4g, 100 Hz ODR, Normal Mode

Step 1: Put the device into Standby Mode: Register 0x2A CTRL_REG1

IIC_RegWrite(0x2A, 0x18); //Set the device in 100 Hz ODR, Standby

Step 2: Set Configuration Register for Motion Detection by setting the “OR” condition OAE = 1, enabling

X, Y, and the latch

IIC_RegWrite(0x15, 0xD8)

Step 3: Threshold Setting Value for the Motion detection of > 3g //(I tried with less Threshold)

Note: The step count is 0.063g/ count

• 3g/0.063g = 47.6; //Round up to 48

IIC_RegWrite(0x17, 0x30)

Step 4: Set the debounce counter to eliminate false readings for 100 Hz sample rate with a requirement

of 100 ms timer.

Note: 100 ms/10 ms (steps) = 10 counts

IIC_RegWrite(0x18, 0x0A);

Step 5: Enable Motion/Freefall Interrupt Function in the System (CTRL_REG4)

IIC_RegWrite(0x2D, 0x04);

Step 6: Route the Motion/Freefall Interrupt Function to INT1 hardware pin (CTRL_REG5) //(I tried with int1 and int2)

IIC_RegWrite(0x2E, 0x04);

Step 7: Put the device in Active Mode

CTRL_REG1_Data = IIC_RegRead(0x2A);

CTRL_REG1_Data| = 0x01;

IIC_RegWrite(CTRL_REG1_Data);

Step 8: Write Interrupt Service Routine Reading the System Interrupt Status and the Motion/Freefall

Status

 

I did exactly, but with the correct register numbers for the FXOS8700CQ sensor.

 

I'm using a FRDM-K64F with its embedded accelerometer and Processor Expert for the I2C communication. The pins are correctly configured and the I2C communication works good but I don't get an interrupt when I move it.

 

Is there something that I'm missing?

 

Thanks for the help!

Outcomes