I am not able to use the FXOS8700CQ accelerometer present on the kv31f board.
I would like to use the freefall function and for this I configured the following registers.
Freefall Configuration | Z < 0,3g using MFF Function 4g, 100 Hz ODR, Normal Mode | |||||
Register Name | Register Addr | Data (R/W) | Description | |||
CTRL_REG1 | 0x2A | 0x00 W | Standby mode for writable operations | |||
WHO_AM_I | 0x0D | Read | Check device communication (0xC7) | |||
XYZ_DATA_CFG | 0x0E | 0x01 W | Hight-pass filter disabled, +/-0.488mg/LSB | |||
CTRL_REG1 | 0x2A | 0x18 W | Set the device in 100 Hz ODR, Standby | |||
A_FFMT_CFG | 0x15 | 0xA0 W | Latch enable, Freefall, Z axis | |||
A_FFMT_THS | 0x17 | 0x05 W | 0,3g threshold | |||
A_FFMT_COUNT | 0x18 | 0x0A W | Debounce 100ms | |||
CTRL_REG4 | 0x2D | 0x04 W | FF interrupt enable | |||
CTRL_REG5 | 0x2E | 0x04 W | interrupt routed to INT1 pin | |||
CTRL_REG1 | 0x2A | 0x19 W | Set the device in 100 Hz ODR, Active Mode |
- The communication is working properly because I can read the WHO_AM_I register,
- I've already followed the AN4070 document,
But it's not working, the Freefall interrupt isn't happening,
I've tried to use the 3 axes and then only one but none worked.
Is there any other register that I need to configure?
What else should I do?
Thanks
Hello Paulo,
Your configuration seems correct.
Please make sure you have the correct pin configuration using the FRDM-KV31F as mentioned below, especially the INT1 pin:
Please try to decrease the value of the debounce counter (A_FFMT_COUNT = 0x01). Can you share your results? Is the interrupt generated at the PTD0 pin?
Regards,
David
Hello,
There was a mistake on I2C write messages,
So I could read the Who_Am_I but when I was trying to write to registers it was working..
In the end the configuration that I did was:
Register Name | Register Addr | Data (R/W) | ||||
CTRL_REG2 | 0x2B | 0x40 W | Reset all registers to POR values | |||
XYZ_DATA_CFG | 0x0E | 0x00 W | Hight-pass filter disabled, +/-0.244mg/LSB, Full-Scale range +/-2g | |||
M_CTRL_REG | 0x5B | 0x00 W | Only accelerometer sensor is active | |||
CTRL_REG2 | 0x2B | 0x02 W | High Resolution mode | |||
CTRL_REG3 | 0x2C | 0x00 W | Push-pull, active low interrupt | |||
A_FFMT_CFG | 0x15 | 0x08 W | Freefall detection for X axis | |||
A_FFMT_THS | 0x17 | 0x04 W | Threshold Setting Value for the Freefall detection of 0.2g (4 * 0.063) | |||
A_FFMT_COUNT | 0x18 | 0x0A W | Set the debounce counter to 1,6s timer (160ms * 10) | |||
CTRL_REG4 | 0x2D | 0x04 W | FF interrupt enable | |||
CTRL_REG5 | 0x2E | 0x04 W | interrupt routed to INT1 pin | |||
CTRL_REG1 | 0x2A | 0x35 W | ODR = 6.25Hz, Reduced noise, Active mode |
Thanks,
Best Regards,
João Paulo