H3LIS331DL interrupt duration issues
I'm using the H3LIS331DL high-g accelerometer. Below is my setup code including register configuration:
void init(void)
{
// Write to CTRL_REG3: interrupt active high, push-pull, no latching, data ready signal on INT1
write_data = 0x02;
i2c_write(0x18, 0x22, &write_data, 1);
// Write to CTRL_REG2: boot normal mode, high-pass filter normal mode,
// filter off, filter coefficient 00
write_data = 0x00;
i2c_write(0x18, 0x21, &write_data, 1);
// Write to INT1_CFG: enable interrupt for all 3 axis high or low readings (using OR logic)
write_data = 0x3f;
i2c_write(0x18, 0x30, &write_data, 1);
// Write to CTRL_REG4: set BDU true (update L and H at same time), and set scale 400G
write_data = 0x80 | (0x03 << 4);
i2c_write(0x18, 0x23, &write_data, 1);
// Write to CTRL_REG1: power into normal mode, enable all three axes, and set data rate 1000Hz
write_data = 0x27 | (0x03 << 3);
i2c_write(0x18, 0x20, &write_data, 1);
}
Upon the interrupt getting triggered, I'm performing the following:
void interrupt_handler(void)
{
// Read all 6 OUT registers to get data all axes data; use register address 0xA8 for auto
// increment starting at register HIGHG_REG_OUT_X_L (0x28)
i2c_read(0x18, 0xA8, 6);
}From looking at a logic analyzer, I've seen that the interrupt signal from INT1 does not get pulled low until I have completed reading all 6 bytes of the accelerometer OUT registers.
The problem that I'm facing is this: my application has quite a bit of processing and is also performing other I2C writes/reads on the same bus. Sometime I'm not able to complete the read of the 6 bytes before 1ms has elapsed (at which time the next sample would be ready, since I'm using a 1000Hz data rate). When this read occurs too late, the interrupt signal just stays high and therefore my software interrupt does not trigger again, causing me to miss further reads of data.
Is it possible to have the interrupt signal simply pulse high for a short period of time every time new data is available, such that it always drops back low regardless of whether I read the data or when I read the data? I know this is possible with some other ST sensors (e.g. LSM6DS3H), but I can't figure out how to do it with the H3LIS331DL.
I tried using the latching feature as well, and it didn't seem to have any impact or work as described in the datasheet. The datasheet says that the interrupt resets after reading the INT1_SRC register, but when I tried this out the behavior seemed exactly the same as before: reading INT1_SRC didn't cause the interrupt signal to reset; however when I complete a read of the 6 data bytes it does reset.
Any help here would be appreciated.
