Skip to main content
Visitor II
April 22, 2021
Solved

Can we have wakeup recognition and single-tap recognition in the same time ?

  • April 22, 2021
  • 2 replies
  • 2989 views

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.

    This topic has been closed for replies.
    Best answer by niccolò

    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ò

    2 replies

    ST Employee
    April 22, 2021

    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ò

    CSo.1Author
    Visitor II
    April 22, 2021

    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.

    ST Employee
    April 23, 2021

    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ò

    CSo.1Author
    Visitor II
    April 23, 2021

    Hi,

    I have provided you a screenshot with the values of each register. I have interrupt when I move or tap the accelerometer, but when I see the status register I still have 0.

    Cassandre