Hi,
I would like to ask you for help with configuration of MMA8451Q accelerometer. I need to read data at 800Hz ODR, 14 bit resolution. I'm trying to set the TRIGGER MODE to FIFO. I would like to set the accelerometer so that when watermark is reached, then the interrupt is generated.
My settings of the accelerometer is not working. Setting is as follows:
// FIFO TRIGGER MODE
iic_acc_send(IIC_ACC_ADDR_MMA8451Q, 0x2A, 0x00);// standby,800Hz,14 bit
iic_acc_send(IIC_ACC_ADDR_MMA8451Q, 0x09, 0xC8);// Triger, watermark = 8 dec
iic_acc_send(IIC_ACC_ADDR_MMA8451Q, 0x0A, 0x00);// no trig 0x00
iic_acc_send(IIC_ACC_ADDR_MMA8451Q, 0x2D, 0x40);// int_en_fifo = 1
iic_acc_send(IIC_ACC_ADDR_MMA8451Q, 0x2E, 0x40);// INT1 // 0x00 = INT2
iic_acc_send(IIC_ACC_ADDR_MMA8451Q, 0x0E, 0x02);// Set 8G - HP OFF
iic_acc_send(IIC_ACC_ADDR_MMA8451Q, 0x2A, 0x01);// active, 800Hz, 14 bit
Please can you advise me what is wrong?
I would also like to ask you how to implement the reading sequence in order to reset interrupt flag in accelerometer.
Thanks for your advice,
George