cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH12 FIFO Watermark interrupt configuration

Morrigan Aensland
Associate II
Posted on June 02, 2017 at 07:35

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.

A

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

Thank you.

#accelerometer-lis2dh12-configure #lis2dh12 #no-interrupt
3 REPLIES 3
Morrigan Aensland
Associate II
Posted on June 07, 2017 at 09:04

Hello,

Could anyone please help me to take a look the above register setting?

I want to config the fifo watermark interrupt on INT1.

but

the INT1 pin always stays LOW.

Thank you very much.

Miroslav BATEK
ST Employee
Posted on June 07, 2017 at 10:26

The register configuration, which you have in the comments, is correct. I replicated this configuration and the I can confirm the interrupt is triggered when the FIFO reach the watermark. I would recommend you to double check the register addresses and the functions to set the register value. You can also try to read back the register values to check it is set as you expect.

If you have the INT1 connected to a microcontroller you should also check that the pin is configured as input so it doesn't force the low level on the pin.

Did you check the level on INT1 with scope or logic analyzer?

Posted on June 08, 2017 at 04:39

Miroslav, 

Yes, I checked the level on INT1 with scope, it always stays low.

Since the register configuration is correct (confirmed by read back) , so I think the problem may due to the PCB or MCU.

Thank you very much for your help.