Skip to main content
Visitor II
May 11, 2021
Solved

Orientation read not function

  • May 11, 2021
  • 3 replies
  • 1524 views

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

    This topic has been closed for replies.
    Best answer by niccolò

    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ò

    3 replies

    ST Employee
    May 11, 2021

    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ò

    EOved.1Author
    Visitor II
    May 11, 2021

    Hi.

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

    ST Employee
    May 11, 2021

    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.1Author
    Visitor II
    May 12, 2021

    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

    niccolòAnswer
    ST Employee
    May 13, 2021

    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.1Author
    Visitor II
    May 13, 2021

    Hi.

    Understood

    thanks.