AnsweredAssumed Answered

LPS22HB: INTERRUPT_SOURCE register is reset without reading it.

Question asked by Mant Sandy on Aug 1, 2017
Latest reply on Aug 2, 2017 by Mant Sandy

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



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?




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?