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
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
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
Step 5: Enable Motion/Freefall Interrupt Function in the System (CTRL_REG4)
Step 6: Route the Motion/Freefall Interrupt Function to INT1 hardware pin (CTRL_REG5) //(I tried with int1 and int2)
Step 7: Put the device in Active Mode
CTRL_REG1_Data = IIC_RegRead(0x2A);
CTRL_REG1_Data| = 0x01;
Step 8: Write Interrupt Service Routine Reading the System Interrupt Status and the Motion/Freefall
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!