LIS3DH | Switching interrupt type during readout leads to unlikely values
Hello
I am using the LIS3DH to detect an impact on a vehicle. Our layout does contain only one interrupt pin, so I have to switch during the event.
Init:
- Clear all registers
- CTRL_REG1 (400Hz, XYZ enabled)= CTRL_REG1_ODR2 | CTRL_REG1_ODR1 | CTRL_REG1_ODR0 | CTRL_REG1_XEN | CTRL_REG1_XEN | CTRL_REG1_XEN
- CTRL_REG2 (HP filter for interrupt and output buffer = CTRL_REG2_FDS | CTRL_REG2_HP_IA1
- CTRL_REG3 (interrupt IA1) = CTRL_REG3_I1_IA1
- CTRL_REG4 (+-8G) = CTRL_REG4_FS1
- INT1_THS (504mg) = 0x08
- INT1_CFG (enable xyz interrupts) = INT1_CFG_YHIE | INT1_CFG_XHIE | INT1_CFG_ZHIE
- CTRL_REG5 (enable FIFO) = CTRL_REG5_FIFO_EN
- FIFO_CTRL_REG (watermark 16, stream-to-fifo )= 16 | FIFO_CTRL_REG_FM1 | FIFO_CTRL_REG_FM0
- read REFERENCE_ADDRESS
I build a pendulum to have a predictable signal. This seems to work well as I do get an interrupt:
- Interrupt received, read last 32 Samples in FIFO
- Change interrupt to watermark
- read 14 times 16 samples when watermark interrupt occurs
- Change interrupt to threshold
This seems to work quite good, as I get the amount of data I am looking for.
But the data I do receive is not looking as I expect, there is nothing that looks like a pendulum and it does have spikes in it.
Can somebody tell my where I do have an error in my procedure?
Kind regards
