cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating THRESH1 for the FSM and ISM330BX accelerometer

reefwing
Associate II

I'm doing a 4D orientation detection FSM on the ISM330BX. There is no example for this IMU so I'm following the examples for some of the other IMUs. That is fine and the code works, but what I can't work out is how to calculate the THRESH1 value and get it to agree with the value displayed in MEMS-Studio.

As shown in the attached screenshot, 0x3A66 (14950 in decimal) is shown as 0.8 g in MEMS-Studio for the ISM330BX, but if I work it out:
Value in g = 14950 x 0.000061 g/LSB = 0.913 g

Any ideas on what I am misunderstanding?

It doesn't really matter from a FSM perspective whether THRESH1 = 0.8 or 0.91 g but still...

1 ACCEPTED SOLUTION

Accepted Solutions
Federica Bossi
ST Employee

Hi @reefwing ,

FSM thresholds are stored in registers in half-precision floating-point format, so 0x3A66 does not actually represents 14590, but 0.8.
Moreover, FSM threshold values are independent from full scale, and what is stored in registers is directly the value in g.
Therefore, 0x3A66 represents a threshold of 0.8 g independently from the selected full scale.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
Federica Bossi
ST Employee

Hi @reefwing ,

FSM thresholds are stored in registers in half-precision floating-point format, so 0x3A66 does not actually represents 14590, but 0.8.
Moreover, FSM threshold values are independent from full scale, and what is stored in registers is directly the value in g.
Therefore, 0x3A66 represents a threshold of 0.8 g independently from the selected full scale.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
reefwing
Associate II

Hi @Federica,

Thank you very much, it was driving me crazy that I couldn't work it out!