High current consumption on the LSM6DSM while checking for Activity
Hi,
I'm using a LSM6DSM to detect periods of inactivity and put a MCU to sleep. Similarly, it uses the activity interrupt to wake the MCU. I observed an average current consumption of ~0.7 mA when configured to check for inactivity(Gyro enabled and ODR is 52Hz for accel and gyro). The average current consumption of the LSM6DSM is ~0.38mA after the inactivity interrupt is triggered, even though I've set the Gyro to be powered down.
I've used the STMems Standard C drivers and below is the code snippet I've used to configure the inactivity interrupt:
/* Reset IMU */
lsm6dsm_reset_set(&dev_ctx, PROPERTY_ENABLE);
do
{
lsm6dsm_reset_get(&dev_ctx, &I2C_Response);
}
while (I2C_Response);
/* Enable Block Data Update */
lsm6dsm_block_data_update_set(&dev_ctx, PROPERTY_ENABLE);
/* Set full scale */
lsm6dsm_xl_full_scale_set(&dev_ctx, LSM6DSM_2g);
lsm6dsm_gy_full_scale_set(&dev_ctx, LSM6DSM_2000dps);
/* Set Output Data Rate */
lsm6dsm_xl_data_rate_set(&dev_ctx, LSM6DSM_XL_ODR_52Hz);
lsm6dsm_gy_data_rate_set(&dev_ctx, LSM6DSM_GY_ODR_52Hz);
lsm6dsm_xl_power_mode_set(&dev_ctx, LSM6DSM_XL_NORMAL);
lsm6dsm_gy_power_mode_set(&dev_ctx, LSM6DSM_GY_NORMAL);
lsm6dsm_int_notification_set(&dev_ctx, LSM6DSM_INT_LATCHED);
lsm6dsm_wkup_threshold_set(&dev_ctx, 2);
lsm6dsm_act_mode_set(&dev_ctx, 3);
lsm6dsm_act_sleep_dur_set(&dev_ctx, 2);
/* Set Accelerometer Data-Ready Interrupt */
lsm6dsm_pin_int2_route_get(&dev_ctx, &int_2_reg);
int_2_reg.int2_inact_state = PROPERTY_ENABLE;
lsm6dsm_pin_int2_route_set(&dev_ctx, int_2_reg);
I have measured the average current consumption of my circuit with and without the LSM6DSM, so I believe these values to not be caused by the MCU. Is there anything wrong with this code or is there something I'm missing here??
Thanks in advance
