cancel
Showing results for 
Search instead for 
Did you mean: 

LPS22HB: INTERRUPT_SOURCE register is reset without reading it.

Mant Sandy
Associate III
Posted on August 01, 2017 at 13:43

I am using lps22HB and connected it to edison through I2C interface.

Env:

I am using mraa and node JS.

This is how I configured the sensor

        i2cBus.writeReg(INTERRUPT_CFG, AUTOZERO | DIFF_EN | PHE | PLE);

        i2cBus.writeReg(THS_P_L, (THS_P & 0xFF));

        i2cBus.writeReg(THS_P_H, (THS_P>>8) & 0xFF);

In the above code, I am using Differential threshold of pressure low and pressure high events.

With this setup, when I poll for an differential pressure interrupt on INT_SOURCE register, I am able to accurately catch pressure low and pressure high events.

But I dont want to do such tight polling..

If I change the code to check for the generated interrupt once in every 1 second, it is not working. Somehow the generated interrupt is being cleared off without me reading the INT_SOURCE register

Is there a way to configure the sensor in such a way that the interrupt is actually not cleared until I read it?

--------------------

ps:

From the ST driver code for LPS22HB, I saw a comment that stated

'

(It is cleared by reading it)

'

So, is it that in the background the system is internally reading this register somehow and therefore it is being cleared?

1 ACCEPTED SOLUTION

Accepted Solutions
Mant Sandy
Associate III
Posted on August 02, 2017 at 11:13

After I set LIR bit in interrupt config register, it starts to work as expected(The interrupt is not cleared until it is read).

View solution in original post

1 REPLY 1
Mant Sandy
Associate III
Posted on August 02, 2017 at 11:13

After I set LIR bit in interrupt config register, it starts to work as expected(The interrupt is not cleared until it is read).