Skip to main content
Visitor II
January 20, 2018
Question

IIS2DH Activity/Inactivity threshold setting

  • January 20, 2018
  • 1 reply
  • 1666 views
Posted on January 20, 2018 at 05:15

Hi, I have configured accelerometer's registers as follows. So, from the activity threshold value how I know that at which raw value of X, Y, and Z axis it will be interrupted on a specific pin?

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

response = LIS3DH_SetODR(LIS3DH_ODR_10Hz);

if(response==1){

print('SET_ODR_OK\r\n');

}

response = LIS3DH_SetMode(LIS3DH_LOW_POWER);

if(response==1){

print('SET_MODE_OK\r\n');

}

response = LIS3DH_SetFullScale(LIS3DH_FULLSCALE_2);

if(response==1){

print('SET_FULLSCALE_OK\r\n');

}

response = LIS3DH_SetAxis(LIS3DH_X_ENABLE | LIS3DH_Y_ENABLE | LIS3DH_Z_ENABLE);

if(response==1){

print('SET_AXIS_OK\r\n');

}

response = LIS3DH_SetFilterDataSel(MEMS_ENABLE);

if(response==1){

print('Filter Data Selection enable\r\n');

}

response = LIS3DH_SetInt2Pin(LIS3DH_INT_ACTIVITY_ENABLE|LIS3DH_INT_ACTIVE_LOW);

if(response==1){

print('ACTIVITY enable\r\n');

}

response = LIS3DH_SetInt2Configuration(LIS3DH_INT2_OR|LIS3DH_INT2_ZHIE_ENABLE|LIS3DH_INT2_ZLIE_ENABLE|LIS3DH_INT2_YLIE_ENABLE|LIS3DH_INT2_YHIE_ENABLE|LIS3DH_INT2_XLIE_ENABLE|LIS3DH_INT2_XHIE_ENABLE);

if(response==1){

print('INT2 configuration\r\n');

}

response = LIS3DH_ActThreshold(0x08);

if(response==1){

print('ACTIVITY threshold set\r\n');

}

response = LIS3DH_SetActDuration(0x0a);

if(response==1){

print('ACTIVITY duration set\r\n');

}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I have set 0X08 into act threshold register so at which raw data on X,Y,Z axis I will get interrupt. Moreover, I have also disable two axis and tried to getting interrupt only on specific axis but the it will not working properly. So, could you help me to do this? Thanks.

    This topic has been closed for replies.

    1 reply

    ST Employee
    January 24, 2018
    Posted on January 24, 2018 at 11:14

    First of all, this is nonsesne:

    LIS3DH_SetInt2Configuration(LIS3DH_INT2_OR|LIS3DH_INT2_ZHIE_ENABLE|LIS3DH_INT2_ZLIE_ENABLE|LIS3DH_INT2_YLIE_ENABLE|LIS3DH_INT2_YHIE_ENABLE|LIS3DH_INT2_XLIE_ENABLE|LIS3DH_INT2_XHIE_ENABLE);

    This condition is always true, because you enable both cases 'higher than' and 'lower than' threshold.

    Which axis reach the threshold can be found in INT1_SRC or INT2_SRC registers.

    Visitor II
    January 24, 2018
    Posted on January 24, 2018 at 14:00

    Hi Miroslav, my requirement is to when some movement occurs accelerometer will wake up. So, that is why I have configured for both the event for threshold and in my case, I have used activity interrupt and as per data sheet, only INT2 will be used for activity threshold. How I configure accelerometer for any movement occurs it will wake up? Could you explain if 

    I have set 0X08 into act threshold register so at which raw data on X, Y, Z axis I will get interrupted?

    ST Employee
    January 26, 2018
    Posted on January 26, 2018 at 18:47

    Here is description of the interrupt threshold, the value is related to used Full Scale.

    0690X00000609SiQAI.png