Skip to main content
Explorer II
September 24, 2022
Question

LSM303C Click event setup

  • September 24, 2022
  • 1 reply
  • 772 views

LSM303DLH has CLICK register to setup it but LSM303C has only commont THS and DUR registers set, can I use it to detect single tap event?

0693W00000SwAFnQAN.png 

As I understand I can setup AND config for all axis, but it doesnt work so good and I can get false detection for some angels of device

void LSM303C_AccConfigTapOnInt1(void)
{
 uint8_t reg_val = ACCELERO_IO_Read(LSM303C_CTRL_REG3_A) | 0x08; /* interrupt on INT1 */
 ACCELERO_IO_Write(LSM303C_CTRL_REG3_A, reg_v);
 
 reg_val = 1;
 ACCELERO_IO_Write(LSM303C_IG_THS_X1_A, reg_v);
 ACCELERO_IO_Write(LSM303C_IG_THS_Y1_A, reg_v);
 ACCELERO_IO_Write(LSM303C_IG_THS_Z1_A, reg_v);
 
 reg_val = 100;
 ACCELERO_IO_Write(LSM303C_IG_DUR1_A, reg_v);
 
 reg_val = LSM303C_AND_COMBINATION | LSM303C_X_HIGH | LSM303C_Y_HIGH | LSM303C_Z_HIGH; 
 ACCELERO_IO_Write(LSM303C_IG_CFG1_A, reg_val );
}

My aproach is right? Is possible to do it on LSM303C ?

*my ODR is 100Hz

Note: I already use inactivity resicters, therefore for tap detection I have only INT1 or INT2 events

INT2 also used for freeFall detection

    This topic has been closed for replies.

    1 reply

    ST Employee
    September 29, 2022

    Hi @Denis Krasutski​ ,

    First, I suggest you not to use the LSM303C product, since it is obsolete.

    You might try to change the duration of, and/or to activate the High-pass filter in the CTRL_REG2_A (21h) register.

    -Eleon