I'm using FXAS21002 on LPC1549 with written code that drive I2C interface. It configured to use 32 FIFO with watermark setting 32, the code working fine on circular loop mode excepts that it took 2.1 second before INT (interrupt) occurred which invoke LPC1549 to extract data.
I expected 2.56 Second based on ODR 12.5Hz.
I reviewed the datasheet and check ODR tolerance which is +/-2.5% which ruled out.....so I not sure what happening here.
I have data result X,Y,Z and seem to be working fine, I did rotation test on device and it should good reading.
I could not check status reg from the FXAS because it crash I2C if attempting to transfer data correctly, so I had to limit I2C only for data transfer and stop operation.
Below is the config setting.
I2C_Write_Register_Byte(G_CTRL_REG1, 0x40); // Reset all registers to POR values
I2C_Write_Register_Byte(G_F_SETUP, 0b10100000); // 32 Count and Circular Mode
I2C_Write_Register_Byte(G_INT_SRC_FLAG, 0b00000100); // Select SRC_FIFO as source interrupt
I2C_Write_Register_Byte(G_CTRL_REG0, 0b00000011); // LPF = 256Hz, HPF disabled, HPF cutoff frequency = N/A, +/-250 dps range -> 7.8125 mdps,
I2C_Write_Register_Byte(G_CTRL_REG2, 0b11000010); // Enable FIFO interrupt, mapped to INT1 - PTA5, push-pull, active low interrupt
I2C_Write_Register_Byte(G_CTRL_REG1, 0b00011100); // ODR = 25Hz, Standby mode
I2C_Write_Register_Byte(G_CTRL_REG3, 0b00001000); // WRAPTOONE=1 for FIFO method.
I calculated that it should take less than 5mSec for I2C to complete data transfer 192 byte worth. 6 8 32 = 192 byte which well within the next sample timing to complete the transfer.