AnsweredAssumed Answered

LIS2DH12 FIFO Watermark interrupt configuration

Question asked by Morrigan Aensland on Jun 2, 2017
Latest reply on Jun 8, 2017 by Morrigan Aensland

Hello,

 

I am using following resister setting to config the LIS2DH12 to generate FIFO watermark interrupt on INT1 pin, however the INT1 pin always stays LOW, I am not sure what I am missing.

INT1 is connect directly to the MCU GPIO pin which set to input.

 

Here are the register settings I'm currently using:

 

//Enable BDU, CTRL_REG4 = 0x80

LIS2DH12_SetBDU(LIS2DH12_ENABLE );

 

// Set to normal power mode, 10bit ACC data, CTRL_REG1 = 0x00, CTRL_REG4 = 0x80

LIS2DH12_SetMode(LIS2DH12_NORMAL );

 

// Full scale selection, CTRL_REG4 = 0x80

LIS2DH12_SetFullScale(LIS2DH12_FULLSCALE_2);

 

// Enable axes, CTRL_REG1 = 0x07

LIS2DH12_SetAxesEnabled(LIS2DH12_X_ENABLE | LIS2DH12_Y_ENABLE | LIS2DH12_Z_ENABLE);

 

// set ODR to 1Hz, CTRL_REG1 = 0x17

LIS2DH12_SetODR(LIS2DH12_ODR_1Hz);

 

// set FIFO watermark to 24, FIFO_CTRL_REG = 0x18

LIS2DH12_SetWaterMark(24);

 

// set Fifo watermark interrupt on INT1, CTRL_REG3 = 0x04

LIS2DH12_SetInt1Pin(LIS2DH12_WTM_ON_INT1_ENABLE);

 

// Interrupt 1 Latch enable, CTRL_REG5 = 0x08

LIS2DH12_Int1LatchEnable(LIS2DH12_ENABLE);

 

// enable fifo mode, CTRL_REG5 = 0x48, FIFO_CTRL_REG = 0x58

LIS2DH12_FIFOModeEnable(LIS2DH12_FIFO_MODE);

 

After few seconds, I read the FIFO_SRC_REG register, the FSS[4:0] field is counting up,

and finally the value of FIFO_SRC_REG = 0xDF. Therefore I think FIFO is working,

however I cannot get the FIFO watermark interrupt for INT1.

 

Any suggestion on how to configure the interrupt correctly would be greatly appreciated.

Thank you.

Outcomes