cancel
Showing results for 
Search instead for 
Did you mean: 

Orientation read not function

EOved.1
Associate II

Dear Sir.

Using LSM6DSL with spi interfae works fine.

Trying to read the orientation I get no output

The configuration is

Write 60h to CTRL1_XL

Write 80h to TAP_CFG

Write 40h to TAP_THS_6D

Write 01h to CTRL8_XL

Write 04h to MD1_CFG

I read the registers LSM6DSL_WHO_AM_I followed by LSM6DSL_D6D_SRC

using polling every 1 sec.

LSM6DSL_WHO_AM_I gives output as expected.

LSM6DSL_D6D_SRC reads zero , See attached pic

Please Advise

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Community member​ ,

it should be impossible to trigger two axis at once because of the thresholds.

just think with basic geometry.

to have 2 axis active at once the angles should be larger than 90° (=360°/4), while the maximum threshold is 80°.

Niccolò

View solution in original post

6 REPLIES 6
niccolò
ST Employee

Hi @Community member​ ,

maybe the timing of the read is not right.

in this case you can try to set the LIR bit in register TAP_CFG to latch the interrupt so that it remains high until you read it

let me know if this helps

Niccolò

Hi.

Setting LIR bit , no effect , Tilting DUT no output when reading register D6D_SRC .

Hi @Community member​ ,

the configuration seems right to me.

can you confirm that you read output data, so that we can rule out bigger problems?

also, did you solve the problems you had while reading the WHO_AM_I register?

I mean, are you sure it is not the same problem?

Niccolò

EOved.1
Associate II

Hi.

It looks like some procedure erased the configuration , Now it works .

One more thing .

AN5040 section 5.4 states

6D interrupt is generated when, for two consecutive samples, only one axis exceeds a selected threshold and the acceleration values measured from the other two axes are lower than the threshold: the ZH, ZL, YH, YL, XH, XL bits of the D6D_SRC register indicate which axis has triggered the 6D event.

  1. What if two axes are beyond threshold ? . How can I tell the xyz state ?
  2. Is it possible that register D6D_SRC (1Dh) can have the status of XH,YL or XH,ZH at the same time ?.

Thanks

Hi @Community member​ ,

it should be impossible to trigger two axis at once because of the thresholds.

just think with basic geometry.

to have 2 axis active at once the angles should be larger than 90° (=360°/4), while the maximum threshold is 80°.

Niccolò

EOved.1
Associate II

Hi.

Understood

thanks.