Skip to main content
NA1
Associate
March 3, 2021
Solved

Can the LIS2DH Fifo be configured in Low power( 8 bit) mode with watermark interrupt, or it is restricted to the 10 bit Normal mode?

  • March 3, 2021
  • 3 replies
  • 1230 views

..

    This topic has been closed for replies.
    Best answer by Eleon BORLINI

    Hi @NA1​ ,

    the FIFO block (and the watermark interrupt) can be used in all the 3 modes of the LIS2DH sensor, low power, normal and high resolution mode. The interrupt will

    You can take as example the code for the LIS2DH12, similar to the LIS2DH as regards the FIFO configuration (lis2dh12_read_fifo.c:(

    /* Set FIFO watermark to FIFO_WATERMARK */
     lis2dh12_fifo_watermark_set(&dev_ctx, FIFO_WATERMARK - 1);
     /* Set FIFO mode to Stream mode (aka Continuous Mode) */
     lis2dh12_fifo_mode_set(&dev_ctx, LIS2DH12_DYNAMIC_STREAM_MODE);
     /* Enable FIFO */
     lis2dh12_fifo_set(&dev_ctx, PROPERTY_ENABLE);
     /* Enable Block Data Update. */
     lis2dh12_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
     /* Set Output Data Rate to 1Hz. */
     lis2dh12_data_rate_set(&dev_ctx, LIS2DH12_ODR_25Hz);
     /* Set full scale to 2g. */
     lis2dh12_full_scale_set(&dev_ctx, LIS2DH12_2g);
     
     /* Set device in continuous mode with 12 bit resol. */ --> but you can set here one of the 3 modes
     lis2dh12_operating_mode_set(&dev_ctx, LIS2DH12_HR_12bit);

    Due to the commonality of the FIFO block among some accelerometer, I suggest you to check for example the AN5005 application note (p.51 and on) for a deep insight into the watermark feature.

    Let me please know if you face any issues.

    -Eleon

    3 replies

    Eleon BORLINI
    Eleon BORLINIBest answer
    ST Employee
    March 3, 2021

    Hi @NA1​ ,

    the FIFO block (and the watermark interrupt) can be used in all the 3 modes of the LIS2DH sensor, low power, normal and high resolution mode. The interrupt will

    You can take as example the code for the LIS2DH12, similar to the LIS2DH as regards the FIFO configuration (lis2dh12_read_fifo.c:(

    /* Set FIFO watermark to FIFO_WATERMARK */
     lis2dh12_fifo_watermark_set(&dev_ctx, FIFO_WATERMARK - 1);
     /* Set FIFO mode to Stream mode (aka Continuous Mode) */
     lis2dh12_fifo_mode_set(&dev_ctx, LIS2DH12_DYNAMIC_STREAM_MODE);
     /* Enable FIFO */
     lis2dh12_fifo_set(&dev_ctx, PROPERTY_ENABLE);
     /* Enable Block Data Update. */
     lis2dh12_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
     /* Set Output Data Rate to 1Hz. */
     lis2dh12_data_rate_set(&dev_ctx, LIS2DH12_ODR_25Hz);
     /* Set full scale to 2g. */
     lis2dh12_full_scale_set(&dev_ctx, LIS2DH12_2g);
     
     /* Set device in continuous mode with 12 bit resol. */ --> but you can set here one of the 3 modes
     lis2dh12_operating_mode_set(&dev_ctx, LIS2DH12_HR_12bit);

    Due to the commonality of the FIFO block among some accelerometer, I suggest you to check for example the AN5005 application note (p.51 and on) for a deep insight into the watermark feature.

    Let me please know if you face any issues.

    -Eleon

    NA1
    NA1Author
    Associate
    March 9, 2021

    Thank you very much for your assistance, it all works fine now.

    Due to some functionality additions, I need to use INT2 as Fifo watermark interrupt instead of INT1. Is that possible, and if so how?

    Eleon BORLINI
    ST Employee
    March 9, 2021

    Hi @NA1​ ,

    glad to hear it from you!

    It is possible to route all the INT1 interrupts also on INT2 (so, the I1_WTM signal too), by configuring the I2_INT1 bit of the CTRL_REG6 (25h) register (datasheet, p.36): it allows the Interrupt 1 function to be enabled on INT2 pin.

    -Eleon