cancel
Showing results for 
Search instead for 
Did you mean: 

Axis X is not changing

Ondrej Meca
Associate
Posted on August 14, 2017 at 17:33

Hi,

I'm using LSM6DSL and unable to operate X axis on accelerometer. The Y and Z axes give me the right results but X axis is stable at 32756 and changes only by 5 points. I have 4 devices with LSM6DSL and all behave same. Tested even without FIFO (same result). Because 4 devices do the same, I'm not sure of device fault.

Here is my setup:

/* Enable register address automatically incremented during a multiple byte

access with a serial interface. */

LSM6DSL_ACC_GYRO_W_IF_Addr_Incr(NULL, LSM6DSL_ACC_GYRO_IF_INC_ENABLED);

/* Enable BDU */

LSM6DSL_ACC_GYRO_W_BDU(NULL, LSM6DSL_ACC_GYRO_BDU_BLOCK_UPDATE );

// Low power enabled (XL_HM_MODE = 1)

LSM6DSL_ACC_GYRO_W_LowPower_XL(NULL, LSM6DSL_ACC_GYRO_LP_XL_DISABLED) ;

/* Scale selection. */

LSM6DSL_ACC_GYRO_W_FS_XL(NULL, LSM6DSL_ACC_GYRO_FS_XL_4g );

/* Set accelero FIFO decimation */

LSM6DSL_ACC_GYRO_W_DEC_FIFO_XL(NULL, LSM6DSL_ACC_GYRO_DEC_FIFO_XL_NO_DECIMATION);

/* Set FIFO ODR to highest value */

LSM6DSL_ACC_GYRO_W_ODR_FIFO(NULL, LSM6DSL_ACC_GYRO_ODR_FIFO_6600Hz);

/* Set FIFO_FULL on INT2 */

LSM6DSL_ACC_GYRO_W_FULL_FLAG_on_INT2(NULL, LSM6DSL_ACC_GYRO_INT2_FULL_FLAG_ENABLED);

/* Set FIFO watermark */

LSM6DSL_ACC_GYRO_W_FIFO_Watermark(NULL, FIFO_WATERMARK);

/* Set FIFO depth to be limited to watermark threshold level */

if(LSM6DSL_ACC_GYRO_W_STOP_ON_FTH(NULL, LSM6DSL_ACC_GYRO_STOP_ON_FTH_ENABLED);

/* Set ODR at 104Hz */

LSM6DSL_ACC_GYRO_W_ODR_XL(NULL, LSM6DSL_ACC_GYRO_ODR_XL_104Hz);

/* Set FIFO mode to Continuous */

LSM6DSL_ACC_GYRO_W_FIFO_MODE(NULL, LSM6DSL_ACC_GYRO_FIFO_MODE_DYN_STREAM_2);

Thanks

Ondrej Meca

#lsm6dsl
1 REPLY 1
Babip Bipbop
Associate II
Posted on August 21, 2017 at 10:13

Hey,

Could you also post your reading scheme ? This might be of help to those who would like to help you debug