cancel
Showing results for 
Search instead for 
Did you mean: 

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

utamb
Associate II

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.

5 REPLIES 5
Miroslav BATEK
ST Employee

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

utamb
Associate II

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

Miroslav BATEK
ST Employee

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.

utamb
Associate II

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,

Miroslav BATEK
ST Employee

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.