cancel
Showing results for 
Search instead for 
Did you mean: 

lsm6dsr gyro output abnormal sometimes

E-John
Associate III

Dear SIR,

In my application is to use lsm6dsr gyro values.

When the set is in stationary state, sometimes the X component gyro values become large that cause wrong calculation.

It happens randomly and other sets not seen the case currently.

I have no idea to debug it. Any comments are welcome, thanks.

initiates regs with their values as follows,

reg, val

   {{0x12, 0x04}, // CTRL3_C, bit IF_INC = b'1(Register add automatically incremented during a multiple byte access with a serial interface

  {0x14, 0x60}, // CTRL5_C, Rounding[1:0] = b'11 = gyroscope + accelerometer

  {0x16, 0x00}, // CTRL7_G,

G_HM_MODE = b'0, gyroscope high-performance mode enable

HP_EN_G = b'0, HPF disable

HPM_G[1:0] = b'00, gyroscope digital HP filter = 16mHz

OIS_ON_EN = b'0

USR_OFF_ON_OUT = b'0, accelerometer user offset correction block bypassed

OSI_ON = b'0, OIS disable

  {0x11, 0x4c}, // CTRL2_G, ODR_G[3:0] = b'100, gyroscope ODR = 104Hz,

FS[1:0]_G = b'11, +/- 2000dps

  {0x10, 0x40}, // CTRL1_XL, ODR_[3:0] = b'100, XL ODR = 104Hz

  {0x0a, 0x00}, // FIFO_CTRL4, FIFO+MODE[2:0] =b'000, bypass mode, FIFO disable

ODR_T_BATCH[1:0] = b'00, temperature not batched in FIFO

DEC_TS_BATCH[1:0] = b'00, timestamp not batched in FIFO

  {0x09, 0x00} // FIFO_CTRL3,

BDR_GY[3:0] = b'0000, Gyro not batched in FIFO

BDR_XL[3:0] = b'0000, Accelerometer not batched in FIFO

  {0x0d, 0x00} // INT1_CTRL, not enable INT1

  {0x5e, 0x00} // Function routing on INT1, all routing functions to INT1 are disable

  {0x56, 0x00} // Tap recognition functions,

all are disable

  {0x17, 0x00} // PAGE_RW, all are disable

  {0x18, 0x02} } // I2C slave add of the second ext sensor reg, set to b'0000001

  

what I have tried included

  1. read STATUS_REG(0x1E) data ready bit(bit1 for GDA) to check the data is valid or not, improved but not total solved.
  2. Set CTRL4_C(0x13) DRDY_MASK to b'1

0 REPLIES 0