LIS2DW12 activity/inactivity power consumption too high when inactive
Hello,
I am using the LIS2DW12 accelerometer using Zephyr OS.
Driver code is https://github.com/zephyrproject-rtos/zephyr/tree/master/drivers/sensor/lis2dw12
I configured the chip as follow: ODR is 12_5Hz
lis2dw12_reset_set(ctx, PROPERTY_ENABLE);
lis2dw12_reset_get(ctx, &rst);
lis2dw12_block_data_update_set(ctx, PROPERTY_ENABLE);
lis2dw12_full_scale_set(ctx, LIS2DW12_2g);
lis2dw12_power_mode_set(ctx, LIS2DW12_CONT_LOW_PWR_12bit);
lis2dw12_data_rate_set(ctx, LIS2DW12_XL_ODR_12Hz5);
lis2dw12_all_on_int1_set(ctx, 1);
lis2dw12_act_mode_set(pLis2dw12->ctx, LIS2DW12_DETECT_ACT_INACT);Where the act_mode_set is
lis2dw12_read_reg(ctx, LIS2DW12_WAKE_UP_THS,(uint8_t*) &wake_up_ths, 1);
lis2dw12_read_reg(ctx, LIS2DW12_WAKE_UP_DUR,(uint8_t*) &wake_up_dur, 1);
wake_up_ths.sleep_on = (uint8_t) val & 0x01U;
lis2dw12_write_reg(ctx, LIS2DW12_WAKE_UP_THS,(uint8_t*) &wake_up_ths, 1);
wake_up_dur.stationary = ((uint8_t)val & 0x02U) >> 1;
lis2dw12_write_reg(ctx, LIS2DW12_WAKE_UP_DUR,(uint8_t*) &wake_up_dur, 1);I can successfully detect ACTIVITY and INACTIVITY with the following configuration
lis2dw12_filter_path_set(ctx, LIS2DW12_LPF_ON_OUT);
lis2dw12_filter_bandwidth_set(ctx, LIS2DW12_ODR_DIV_4);
lis2dw12_wkup_dur_set(ctx, duration);
lis2dw12_act_sleep_dur_set(ctx, sleep);
lis2dw12_wkup_threshold_set(ctx, wakeup);
lis2dw12_wkup_feed_data_set(ctx, LIS2DW12_HP_FEED);
lis2dw12_registerCb(handler, trigger);However, when the device enters in the INACTIVITY mode, I see power consumption rising from 600uA to 800uA, giving an increase of ~200uA. It should take the It looks like the LP_MODE and MODE of the CTRL1 register are not taken into account. However, when the device is moving (ACTIVITY), the power consumption is going down again.
I guess something is wrong in the configuration but I cannot find what. Documentation says that if the STATIONARY field is set, the Inactivity and Activity timer are using the values configured by default, but I don't think it is the case, the device seems to be consuming like it is in High Performance.
Thanks
