cancel
Showing results for 
Search instead for 
Did you mean: 

[lis2dh12/lis2dw12] INT1 signal too low/no signal output

wai.1
Associate

Hi guys,

I am currently working on a project with lis2dw12 tap and orientation interrupt. I have come across an issue of INT1 output.

I have tested the INT1 output signal with the code below:

#include "lis2dh_reg.h"
 
void lis2dh_int_test(stmdev_ctx_t dev_ctx)
{
  uint8_t buf[2] = {0x00, 0x00};
  uint32_t state;
  TH_PRINTF("Starting program\r\n");
 
 /* Initialization of sensor */
  buf[1] = 0x40;
  lis2dh_write_reg(&dev_ctx, 0x22, &buf[1], 1);   /* CTRL_REG3 (22h): IA1 interrupt on INT1 pin */
 
  buf[1] = 0x00;
  lis2dh_write_reg(&dev_ctx, 0x23, &buf[1], 1);   /* CTRL_REG4 (23h): Set Full-scale to +/-2g */
 
 /* 6D orientation enable */
  buf[1] = 0x7f;
  lis2dh_write_reg(&dev_ctx, 0x30, &buf[1], 1);   /* INT1_CFG (30h): INT1 Configuration */
 
  buf[1] = 0x36;
  lis2dh_write_reg(&dev_ctx, 0x32, &buf[1], 1);   /* INT1_THS (32h): INT1 Threshold set */
 
  buf[1] = 0x06;
  lis2dh_write_reg(&dev_ctx, 0x33, &buf[1], 1);   /* INT1_DURATION (33h): INT1 Duration set */
 
 /* Start sensor */
  buf[1] = 0x3f;
  lis2dh_write_reg(&dev_ctx, 0x20, &buf[1], 1);   ; /* CTRL_REG1 (20h): Start sensor at ODR 25Hz, Lowpower mode */
 
/* Settling time 1ms */
  nrf_delay_ms(1);
 
  while (1)
  {
    state = nrf_gpio_pin_read(ACCL_INT1);
    if (state) TH_PRINTF("int1 detected \r\n");
  }
}
 
 
 
int main(void)
{   
    uint8_t whoamI,rst;
 
    //lfclk_config();
    //timers_init();
    twi_init();
 
    stmdev_ctx_t dev_ctx;
    dev_ctx.write_reg = platform_write;
    dev_ctx.read_reg = platform_read;
    dev_ctx.handle = NULL;
    nrf_gpio_cfg_input(ACCL_INT1,GPIO_PIN_CNF_PULL_Disabled);
 
    lis2dh_device_id_get(&dev_ctx, &whoamI);
    lis2dh_int_test(dev_ctx);
  
    while (true)
    {
        // Do nothing.
    }
}

,following the application notes dt0097:

https://www.st.com/resource/en/design_tip/dt0097-setting-up-6d-orientation-detection-with-sts-mems-accelerometers-stmicroelectronics.pdf

Nothing was printed when I rotate the module(with lis2dh12). While when I check the INT1 pin with an oscilloscope, I found that the signal was below 1.5v, which was definitely not able to be recognised as an input.

Could anyone suggest that what the problem would be? Or is it normal to see this phenomena with lis2dh12?

p.s. I am using nrf52840-DK.

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @wai.1​ ,

when the interrupt is raised, you should see a voltage equal to the VDD IO level (if in the usual logic convention). Which is your Vdd level?

At hardware level, you should check the default status of the INT1 and INT pins at application processor level (they should have been set as digital inputs).

At software level, you can compare your code with the Github C example --> lis2dw12_orientation.c

Try also to latch the interrupt (LIR_INT1 of CTRL_REG5 (24h) register for the LSI2DH12) and check if it still stays low.

By the way, are you setting the orientation and tap interrupts separately, in different times? You might connect the first one to INT1, and the second one to INT2.

-Eleon