2022-06-09 01:58 AM
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
Solved! Go to Solution.
2022-06-10 09:20 AM
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
2022-06-10 06:16 AM
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
2022-06-10 09:20 AM
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