2024-02-15 06:16 AM
When I configure FIFO, for some reason Z is always around 1g even though HP filter is active.
Here is my setup with FIFO:
write_reg(LIS_ADD, CTRL_REG1, 0x77); // 400 Hz, enable XYZ
write_reg(LIS_ADD, CTRL_REG2, 0x3C); // HP data sent to FIFO and HP enabled for CLICK function
write_reg(LIS_ADD, CTRL_REG3, 0x80); // CLICK on INT1
write_reg(LIS_ADD, CTRL_REG4, 0x30); // 16g, HR disabled
write_reg(LIS_ADD, CTRL_REG5, 0x48); // FIFO EN, LIR_INT1
write_reg(LIS_ADD, FIFO_CTRL_REG, 0x98); // stream mode but FTH doesn't matter because I won't use WTM flag
write_reg(LIS_ADD, CLICK_CFG, 0x15); // single click for XYZ
write_reg(LIS_ADD, CLICK_THS, 0x82); // LIR_click and ths 250mg
write_reg(LIS_ADD, TIME_LIMIT, 0x0F); // 30 ms
write_reg(LIS_ADD, INT1_CFG, 0x00); // XYZ don't generate interrupt
write_reg(LIS_ADD, INT1_THS, 0x02);
write_reg(LIS_ADD, INT1_DURATION, 0x00);
===========================================
When I don't use FIFO, acceleration data are okay.
Here is without FIFO:
write_reg(LIS_ADD, CTRL_REG1, 0x77);
write_reg(LIS_ADD, CTRL_REG2, 0x39); // HP data sent to fifo (even though I won't use it) and HP enabled for AOI function on INT1
write_reg(LIS_ADD, CTRL_REG3, 0x40); // IA1 on INT1
write_reg(LIS_ADD, CTRL_REG4, 0x30);
write_reg(LIS_ADD, CTRL_REG5, 0x08); // LIR_INT1
write_reg(LIS_ADD, INT1_CFG, 0x2A); //enable interrupt generation -> X,Y,Z high event
write_reg(LIS_ADD, INT1_THS, 0x04);
write_reg(LIS_ADD, INT1_DURATION, 0x05);
===========================================
Does anyone know why this happens?? What could be wrong??
BR//
Rodrigo
2024-02-16 12:06 AM
Hi @Rodrigo2IoT ,
Please, can you follow our example on github and let me know if you have the same issue?
Just to understand if it is something related to your code.
Thanks :)