Skip to main content
Visitor II
September 4, 2019
Question

Configure interrupts properly and get real g values

  • September 4, 2019
  • 3 replies
  • 992 views

Hi guys,

I have a question of how configuring 1kHz interrupts on the MEMS Sensor H3LIS331DL.

My configuration is as seen below.

writeByte(STM_ACC_address, STM_CTRL_REG_1, 0x3F, hi2c);

writeByte(STM_ACC_address, STM_CTRL_REG_4, 0x10, hi2c);

writeByte(STM_ACC_address, STM_CTRL_REG_3, 0x14, hi2c);

writeByte(STM_ACC_address, STM_INT1_DURATION, 0x00, hi2c);

I'll get the interrupts on a maximum frequency of 330kHz. With ODR 1000 shouldn't I get them with 1kHz?

In addition I have problems with the raw data converting to g, how can I do this?

Thanks in advance.

Best Matthias

    This topic has been closed for replies.

    3 replies

    ST Employee
    September 6, 2019

    Hi,

    I suppose you need the DRDY signal on INT2 pin. So the value for CTRL_REG3 should be 0x10, if you want DRDY on INT1 then the value should be 0x02.

    The INT1_DURATION doesn't have any meaning for DRDY signal.

    Please be sure you read the data fast enough. The DRDY interrupt signal is reset only if you read the data. So I think you read the data with frequency 330Hz.

    I would also recommend to set the BDU bit in CTRL_REG_4 to have constistency in output data low and high byte.

    qnAuthor
    Visitor II
    September 8, 2019

    naam

    qnAuthor
    Visitor II
    September 16, 2019

    naam