LPS22HB: INTERRUPT_SOURCE register is reset without reading it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-01 4:43 AM
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?
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-02 2:13 AM
After I set LIR bit in interrupt config register, it starts to work as expected(The interrupt is not cleared until it is read).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-08-02 2:13 AM
After I set LIR bit in interrupt config register, it starts to work as expected(The interrupt is not cleared until it is read).
