cancel
Showing results for 
Search instead for 
Did you mean: 

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

CSo.1
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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ò

View solution in original post

11 REPLIES 11
niccolò
ST Employee

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.1
Associate II

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.

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ò

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

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ò

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

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

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ò

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