Skip to main content
Explorer
October 12, 2024
Solved

Calculating THRESH1 for the FSM and ISM330BX accelerometer

  • October 12, 2024
  • 2 replies
  • 972 views

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...

    This topic has been closed for replies.
    Best answer by Federica Bossi

    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.

    2 replies

    Technical Moderator
    October 15, 2024

    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.

    reefwingAuthor
    Explorer
    October 15, 2024

    Hi @Federica,

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