Skip to main content
Visitor II
January 5, 2019
Question

I was wondering how can I set interrupt threshold value in IG_THS_X1 /Y1/Z1 register.

  • January 5, 2019
  • 5 replies
  • 1436 views

I am using LIS2HH12 accelerometer.  In threshold register do I need to write value in terms of g. If I need to set threshold as 0.4 g then how to write .suppose if I want to set +0.4 (or -0.4) , writing 0.4 (float value) in 1 byte is not possible. Any conversion formulae I need use. Please help.

    This topic has been closed for replies.

    5 replies

    ST Employee
    January 6, 2019

    The threshold is in absolute value, the sign is not important. The equivalent value for 1 LSB for different full scale in in following table:

    0690X000006CyJpQAK.png

    Please chapter chapter 6.2 in application note AN4662.

    https://www.st.com/content/ccc/resource/technical/document/application_note/60/52/bd/69/28/f4/48/2b/DM00165265.pdf/files/DM00165265.pdf/jcr:content/translations/en.DM00165265.pdf

    utambAuthor
    Visitor II
    January 7, 2019

    Thank you so much. But if the threshold is absolute value then how am I suppose to set -ve value of g.(like -0.4g). Please help

    ST Employee
    January 7, 2019

    It is not possible to set the sign.

    What would be a purpose of this? Maybe there is different way how to achieve what you want.

    utambAuthor
    Visitor II
    January 8, 2019

    Sir, I know it is not possible.

    My question is how can I calculate count value for negative values of g. I have a requirement like whenever x axis value exceeds -0.5 g then interrupt should set,

    ST Employee
    January 9, 2019

    You can use 6D orientation detection.

    Please read chapter 7 in application note AN4662.

    https://www.st.com/content/ccc/resource/technical/document/application_note/60/52/bd/69/28/f4/48/2b/DM00165265.pdf/files/DM00165265.pdf/jcr:content/translations/en.DM00165265.pdf

    In 6D detection the orientation of the sensor is taken into account.