Skip to main content
Mant Sandy
Associate II
August 1, 2017
Solved

LPS22HB: INTERRUPT_SOURCE register is reset without reading it.

  • August 1, 2017
  • 1 reply
  • 657 views
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?

    This topic has been closed for replies.
    Best answer by Mant Sandy
    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).

    1 reply

    Mant Sandy
    Mant SandyAuthorBest answer
    Associate II
    August 2, 2017
    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).