Skip to main content
Explorer II
June 9, 2022
Solved

Can LIS2DW12 be configured to present TAP interrupt and to give XYZ acceleration values on demand at same time?

  • June 9, 2022
  • 2 replies
  • 903 views

Please,give me your opinion.

I have to develop an anti-tamper board.By now I was asked to select one of 2 working modes:

1)Interrupt on TAP

2)XYZ values on demand ,microcontroller periodically checks variations in XYZ values.

Is it possible to have both at same time?In other words,every second XYZ values are compared with some thresholds,but between measurements (or even during) if a TAP event occurs it must activate the INT pin.

Thanks.

Diego

    This topic has been closed for replies.
    Best answer by Diego Colombo

    Thank you Eleon

    I already have a customer board to test your hints,by now my firmware works as described,I think it would not take long time to have both functionalities.

    Thanks again,

    Diego

    2 replies

    ST Employee
    June 10, 2022

    Hi Diego @Diego Colombo​ ,

    yes it is possible to acquire the data and the interrupts together.

    The interrupt event can be detected both at register level than at hardware level. If you want to run it in parallel with the data acquisition, you have to enable the interrupt routing on a physical pin, either INT1 or INT2

    See for example the C sample code on Github --> lis2dw12_tap_single.c

     /* Enable single tap detection interrupt */
     lis2dw12_pin_int1_route_get(&dev_ctx, &int_route.ctrl4_int1_pad_ctrl);
     int_route.ctrl4_int1_pad_ctrl.int1_single_tap = PROPERTY_ENABLE;
     lis2dw12_pin_int1_route_set(&dev_ctx, &int_route.ctrl4_int1_pad_ctrl);

    -Eleon

    Diego ColomboAuthorAnswer
    Explorer II
    June 10, 2022

    Thank you Eleon

    I already have a customer board to test your hints,by now my firmware works as described,I think it would not take long time to have both functionalities.

    Thanks again,

    Diego