2021-04-22 05:39 AM
To set the wakeup thershold, I use WAKE_UP_THS and for single-tap I use the same functions as the example (https://github.com/STMicroelectronics/STMems_Standard_C_drivers/blob/master/lis2dw12_STdC/example/lis2dw12_tap_single.c). Morever, I set 0x01100000 in CTRL4_INT1_PAD_CTRL, to enable wakeup and single tap interrupts. And when I do that, the bit SINGLE_TAP in STATUS is never at 1, but when I set 0x01000000, it works.
Solved! Go to Solution.
2021-04-23 02:16 AM
Hi Cassandre @CSo.1 ,
with only the register data you gave me I managed to read both WU_IA and SINGLE_ TAP bits of register 27h.
it can be a temporization issue.
Can you try to latch the interrupt?
please, try to set 0x18 intead of 0x08 in CTRL3 and let me know.
Niccolò
2021-04-22 07:25 AM
Hi @CSo.1 ,
maybe your threshold for the tap interrupt is too high?
you should try to modify it using registers TAP_THS_X/Y/Z (30h/31h/32h), as stated on page 17 of datasheet (https://www.st.com/resource/en/datasheet/lis2dw12.pdf)
Let me know if this helps,
Niccolò
2021-04-22 07:34 AM
Thank you for your answer.
When I only test the single-tap (passing CTRL4_INT1_PAD_CTRL at 0x01000000) it works, but when I want to have wakeup and single tap (passing CTRL4_INT1_PAD_CTRL at 0x01000000) I never have single-tap, only wakeup, and I havn't changed the threshold.
2021-04-23 12:26 AM
Hi @CSo.1 ,
can you provide the full register transcription?
I'm trying to reproduce the problem and I'd like to put me exactly in your situation.
Meanwhile, have you tried to change the INT_DUR (33h) values?
maybe there's something to tweak there.
Can I also ask you if the INT is latched or not?
Niccolò
2021-04-23 01:40 AM
2021-04-23 02:16 AM
Hi Cassandre @CSo.1 ,
with only the register data you gave me I managed to read both WU_IA and SINGLE_ TAP bits of register 27h.
it can be a temporization issue.
Can you try to latch the interrupt?
please, try to set 0x18 intead of 0x08 in CTRL3 and let me know.
Niccolò
2021-04-23 02:28 AM
Hi,
When I set 0x18 intead of 0x08 in CTRL3, I don't get any interrupts. But when I set 0x10, I have 0x40 in STATUS for each interrupt.
Cassandre
2021-04-23 02:44 AM
Hi,
It's ok, I have increased wakeup thershold (and setted 0x10 in CTRL3) and now I have single-tap and wakeup, thank you so much for your help.
Cassandre
2021-04-23 04:39 AM
Hi Cassandre @CSo.1 ,
I'm glad to hear you could fix it just by adjusting the threshold.
hope that everything works fine now.
Niccolò
2021-04-23 06:02 AM
Hi,
I haven't just adjusted the threshold, I have changed CTRL3.
I use ST platform-independent software (lis2dw12.h, lis2dw12.c, lis2dw12_reg.h, lis2dw12_reg.c), but tap and double-tap are not implemented in lis2dw12.c/h, only in lis2dw12_reg.c/h, do you know why ?
I have found these files here: https://my.st.com/content/my_st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-mems1.license=1619183955152.product=X-CUBE-MEMS1.version=8.3.0.html
Cassandre