cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DW12 - orientation bit raised

Msaga.1
Associate II

Hello,

I understand from the data sheet that once there is a certain acceleration value in one of the axis that is greater then the threshold and the value at the other axis is lower then the threshold, the orientation bit of the first axis (with value>threshold) is 1 and the others are 0.

What happens in the case that the acceleration value at axis x and y (for example) bigger then the threshold and value at z smaller, which orientation bit should I expect to see ?

Thank you

9 REPLIES 9
Eleon BORLINI
ST Employee

Hi @Msaga.1​ ,

I believe you are referring to the 6D/4D orientation detection digital feature.

If so, I suggest to check the application note AN5038, p. 23 and 24: here the axis configuration are depicted and described in terms of

The bit configuration excludes one with the other, since the threshold is close to 1g and only 1 axis per time can overcome this threshold.

You will need an external acceleration to elicit the "1" flag on more than 1 axis, but in this case you won't be able to detect the orientation any more.

0693W00000AMv7ZQAT.pngWhich is the target application, in your case?

-Eleon

Msaga.1
Associate II

Thank you for your answer Eleon,

If I understand correctly, our boards are Nordic nrf52840 at the moment, and the code is custom code on the Nordic Softdevice.

"The bit configuration excludes one with the other, since the threshold is close to 1g and only 1 axis per time can overcome this threshold." - for example, if the bit was raised on X_L (and the 32 fifo entries had this bit of course) and at the next read, the value in Y_L is > threshold. what will be the bit that has "1" ?

Hi @Msaga.1​ ,

the fact that -in the first batch of samples- you have the X_L=1 (and all the other SIXD_SRD relevant bits = 0) and in the next slot the Y_L is =1 (and all the other SIXD_SRD relevant bits = 0) means that -during the time in which the first FIFO batch has been acquired- the device position was (a) (with reference to the above picture), while in the second FIFO run it was rotated as in (b).

In order to check the orientation stats in real-time, I would suggest you to route the interrupt flag on a physical interrupt pin, and monitor it with your application processor.

-Eleon

Msaga.1
Associate II

Hi @Eleon BORLINI​ ,

What I meant was that , if the bit was raised on X_L (and the 32 fifo entries had this bit of course) and at the next read, *also* the value in Y_L is > threshold, so the movement will be in diagonal. so we will have 2 values > threshold at the same reading, what am I accepting to see then?

Hi @Msaga.1​ ,

if both the bits are raised this means that acceleration in both direction has crossed downwards the Threshold value [in degrees] defined in the 6D_THS[1:0] bits of the TAP_THS_X register, according to the application note p.23.

If these bits have been set to '11', the threshold is 50 degrees and so the movement will be in diagonal. If it is '00', there has been an external acceleration -probably- both along X and along Y, since in this case the threshold value is 80 deg that is close to 90 (i.e. 1g gravity acceleration)

-Eleon

Msaga.1
Associate II

Hi @Eleon BORLINI​  ,

so IT IS possible to see 2 orientation bits raised at the same time? i don't quit understand.

"The bit configuration excludes one with the other, since the threshold is close to 1g and only 1 axis per time can overcome this threshold.

You will need an external acceleration to elicit the "1" flag on more than 1 axis, but in this case you won't be able to detect the orientation any more."

Maya

The last sentence refers to the condition in which there are no external forces acting except the gravity: in this case, especially if the 6D_THS[1:0] bits are at 00h, you'll experience the threshold crossing only on 1 axis. On the other ones the value will be always under 1g.

But in the case your device is receiving an external force additional to the gravity, of course the threshold can be overcome in different directions.

Which is the 6D_THS[1:0] bits configuration? And can you share the FIFO data?

-Eleon

Msaga.1
Associate II

Hi @Eleon BORLINI​ ,

the fifo data doesn't show 2 orientation bits 'raised'. I am only asking if it is possible to see 2 orientation bits raised at the same time. all in theory,

Hi @Msaga.1​ ,

in case the device is stationary, it will not be possible to have more than 1 bit raised.

If you however rotate the device, in the next FIFO batch a new flag will be raised, and the previous one set to 0.

Hope this will clarify better.

-Eleon