cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my INT1 of LIS2DW always at high?

Allen Lin
Associate II
Posted on January 25, 2018 at 18:52

Hi,

    My problem is I can not receive the interrupt signal of INT1 when I using FIFO mode with FIFO buffer full trigger. I find the cause is that the INT1 is always at high, but I expect it should be rise high when FIFO buffer is full.

My HW is 

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mems-motion-sensor-eval-boards/steval-mki179v1.html

(

LIS2DW12TR), I using the following pins for I2C

  

SCL, SDA, VDD, GND, SA0 (connect to 

GND)

My Pin configuration for INT1 on MCU side is

   PIN_GPIO_LOW | PIN_PUSHPULL| PIN_IRQ_POSEDGE

SW startup sequence:

  

if(LIS2DW12_getRegisterValue(LIS2DW12_WHO_AM_I_ADDR) == LIS2DW12_WHO_AM_I_DEF)

    {

      

        LIS2DW12_setRegisterValue(

LIS2DW12_CTRL2_ADDR

, LIS2DW12_BDU_MASK | (commProtocol << 4));  // set BDU on and CS_PUDISC

        LIS2DW12_setRegisterValue(

LIS2DW12_CTRL4_INT1_PAD_ADDR

, LIS2DW12_INT1_FIFO_FULL_MASK); //triger PIN INT1 when FIFO buffer is full

        LIS2DW12_setRegisterValue(

LIS2DW12_CTRL6_ADDR

, LIS2DW12_FS_CODE(fullScaleCode)); //set full scale code

        LIS2DW12_setRegisterValue(

LIS2DW12_FIFO_CTRL_ADDR

, LIS2DW12_FIFO_MODE(LIS2DW12_FIFO_FIFO) | LIS2DW12_SAMPLES(FIFOBuffSize-1));  //set FIFO mode and FIFO buffer size     

        LIS2DW12_setRegisterValue(

LIS2DW12_CTRL7_ADDR

, LIS2DW12_CTRL7_INTERRUPTS_ENABLE_MASK);   //enable the interrupts

        LIS2DW12_setRegisterValue(

LIS2DW12_CTRL1_ADDR

, LIS2DW12_ODR_SELECTION(LIS2DW12_bandWithCode) | LIS2DW12_POWER_MODE(LIS2DW12_powerMode)); 

    }

The above setting of register is showing on following table. The yellow mark label is 1.

0690X00000609UdQAI.png0690X00000609UiQAI.png

I also read the registers after setting 

LIS2DW12_CTRL1_ADDR  

and the result is :

    0x18 (00011000) = LIS2DW12_getRegisterValue(LIS2DW12_CTRL2_ADDR);

    0x04

(00000100)

 = LIS2DW12_getRegisterValue(LIS2DW12_CTRL4_INT1_PAD_ADDR);

    0x30 

(00110000)

= LIS2DW12_getRegisterValue(LIS2DW12_CTRL6_ADDR);

    0x3F 

(00111111)

= LIS2DW12_getRegisterValue(LIS2DW12_FIFO_CTRL_ADDR);

    0x10 (00010000)= LIS2DW12_getRegisterValue(LIS2DW12_CTRL7_ADDR);

    0x24 

(00100100)

= LIS2DW12_getRegisterValue(LIS2DW12_CTRL1_ADDR);

I also test the INT1 status. The INT1 of MCU  is  low if I don't connect it to 

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mems-motion-sensor-eval-boards/steval-mki179v1.html

, but it will always be high after I connect it to 

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mems-motion-sensor-eval-boards/steval-mki179v1.html

.

   

Please help me to check my configuration of registers and startup sequence.

Thank you for your helping.

Best Regards,

Allen

#fifo-buffer-interrupt #fifo-buffer #lis2dw12 #lis2dw
1 REPLY 1
Miroslav BATEK
ST Employee
Posted on January 26, 2018 at 18:19

I checked you configuration and it seems to be correct.

In my case the interrupt goes high if the FIFO is full, and it is cleared if read a sample from FIFO or turn off the FIFO.

Can you please try to turn off the FIFO FIFO_CTRL (0x2E) = 0x00 and check the state of INT1 pin?

Are you sure you configured the interrupt in in the microcontroller as input?