cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH12 correct configuration for stream to FIFO

TNaru.10
Associate

Hi, 

I need to get the FIFO contents prior to impact, to do this, I enable high pass, and go to stream to FIFO mode. But I get an interrupt as soon as I finish configuring

I am configuring LIS2DH12 according to your application note:

CTRL_REG1 = 0x37 // 25Hz, xyz enabled

CTRL_REG2 = 0x0B // high pass data sent to FIFO and output regs

CTRL_REG3 = 0x01 // IA1 interrupt on INT1 pin

CTRL_REG4 = 0x48 // BDU, +-4g full scale reading

CTRL_REG5 = 0x0A // latch both interrupt pins

CTRL_REG6 = 0x14 // interrupt 2 on INT2 pin

INT1_THS = 0x0A // about 0.3g

INT1_DUR = 0x03

INT1_CFG = 0x2A // x high, or y high, or z high

FIFO_CTRL = 0x20 // trigger event allows triggering on INT2

CTRL_REG5 = 0x4A // enable FIFO

FIFO_CTRL = 0xE0 // set mode to stream to FIFO

Can you please take a look and tell me if I'm doing something wrong?

1 REPLY 1
Miroslav BATEK
ST Employee

I see following problem:

CTRL_REG3 = 0x40 // IA1 interrupt on INT1 pin

CTRL_REG4 = 0x90 // BDU, +-4g full scale reading

CTRL_REG6 = 0x20 // interrupt 2 on INT2 pin

Then you configured to trigger the FIFO by INT2, but you configured the INT1 (INT1_THS, UNT1_DUR, INT1_CFG)!