2021-09-14 07:19 PM
Hello, everyone,
we found that the working current is too high during the use of the LIS2DH12 sensor. The current is as high as 290ua. According to the specification, the high resolution of 100Hz is 20ua. The working current is much higher. I don’t know if there is a problem with the configuration. The following is my code , I also tried to configure to play in low-power mode, but the current is not numbered.
int LIS2DH_Init(void)
{
/* step 1: init I2C */
I2C_InitType I2C_InitStruct;
I2C_InitStruct.sck_pin = WRIST_PIN_MOTION_SCL;
I2C_InitStruct.sda_pin = WRIST_PIN_MOTION_SDA;
I2C_Init(&I2C_InitStruct, TWI_GROUP_MOTION);
if(LIS2DH_WHO_AM_I_VALUE != LIS2DH_ReadReg(LIS2DH_WHO_AM_I))
{
return -1;
}
//LIS2DH_Standby();
//LIS2DH_ClearWakeUp();
LIS2DH_WriteReg(LIS2DH_CTRL_REG5, 0x80);
LIS2DH_WriteReg(LIS2DH_CTRL_REG4, 0x00);
LIS2DH_WriteReg(LIS2DH_CTRL_REG3, 0x00);
LIS2DH_WriteReg(LIS2DH_CTRL_REG2, 0x00);
LIS2DH_WriteReg(LIS2DH_CTRL_REG1, 0x00);
LIS2DH_WriteReg(LIS2DH_CTRL_REG6, 0x00);
DelayMS(10);
LIS2DH_WriteReg(LIS2DH_CTRL_REG5, 0x08);
LIS2DH_WriteReg(LIS2DH_CTRL_REG4, LIS2D_SELECT_FULL_SCALE | SELF_TEST_NORMAL_MODE);
LIS2DH_WriteReg(LIS2DH_CTRL_REG1, LIS2D_ODR_100HZ|0x07); //100hz enable xyz
//sleep to wakeup
// LIS2DH_WriteReg(LIS2DH_ACT_THS, 0x00);
// LIS2DH_WriteReg(LIS2DH_ACT_DUR, 0x00);
//configure interrupt enable
LIS2DH_WriteReg(LIS2DH_INT1_CFG, 0x40 | 0x00);
LIS2DH_WriteReg(LIS2DH_INT1_THS, 0x03);
LIS2DH_WriteReg(LIS2DH_INT1_DURATION, 0x02);
LIS2DH_WriteReg(LIS2DH_CTRL_REG5, 0x08);
LIS2DH_Sleep();
GPIO_InitType GPIO_InitStruct;
GPIO_InitStruct.dir = GPIO_PIN_CNF_DIR_Input;
GPIO_InitStruct.pull = GPIO_PIN_CNF_PULL_Pullup;
GPIO_InitStruct.drive = GPIO_PIN_CNF_DRIVE_S0S1;
GPIO_InitStruct.sense = GPIO_PIN_CNF_SENSE_Disabled;
GPIO_InitStruct.input = GPIO_PIN_CNF_INPUT_Connect;
//GPIO_QuickConfigInput(WRIST_PIN_MOTION_INT1);
GPIO_Init(WRIST_PIN_MOTION_INT1, &GPIO_InitStruct);
app_gpiote_user_register(&MotionChannel,(1 << WRIST_PIN_MOTION_INT1),0,LIS2DH_MotionEvent);
app_gpiote_user_enable(MotionChannel);
LIS2DH_DisableWakeUp();
return 0;
}
static void LIS2DH_WakeUpInit(void)
{
LIS2DH_WriteReg(LIS2DH_CTRL_REG0, 0x90);
LIS2DH_WriteReg(LIS2DH_CTRL_REG3, 0x40);
LIS2DH_WriteReg(LIS2DH_INT1_THS, onLis2DHAccelToThreshold() + LIS2DH_WAKEUP_MG_VALUE / onLis2DHGetBitMg());
LIS2DH_WriteReg(LIS2DH_INT1_DURATION, 0x00); //Ö�?¶�?³Ö�?øʱ¼ä
LIS2DH_WriteReg(LIS2DH_INT1_CFG,0x2A); //0x2A
}
2021-09-16 03:35 AM
Hi @党军 �?� ,
Let me please better understand the point.
Are you using the I2C protocol for the communication right?
How did you set the SDO/SA0 pin at hardware / firmware level?
Please note that this is pin has Internal pull-up, and if you are connecting it to the GND layer you have to take into account of the consumption coming from the pullup resisters (see datasheet, p.9):
Or otherwise, you should tie the SDA/SA0 pin to Vdd or disconnect it.
If this is your issue and my reply answered your question, please click on Select as Best at the bottom of this post. This will help other users with the same issue to find the answer faster.
-Eleon
2021-09-18 07:46 AM
Useing the I2C communication,
The SDO/SA0 pin on the hardware is disconnected
2021-09-20 12:10 AM
Try with pulling SDO/SA0 up to Vdd, and then check the consumption.
-Eleon
2021-09-22 04:09 AM
Thanks for you
I tried it and the result was the same.
At present, it is found that the interrupt signal does not match. After we set the MCU interrupt pin to the first level, the current is about 114uA. Including the working current of the MCU.
2021-10-18 06:53 AM
Hi @党军 �?� ,
sorry for the late follow-up.
Could you please share the schematic of your application?
But are you facing the correct consumption level properly setting the interrupts at MCU level?
-Eleon