Skip to main content
党靳.1
Associate II
September 23, 2021
Question

LIS2DH12 Reaction speed

I used the step counter of LIS2DH12 and MMA8542 to make a comparison. I found that LIS2DH12 is a bit slow. For example, we use a step machine to test the bracelet of MMA8542 in 8 hours. The test has more than 60,000 steps, while the number of steps tested by LIS2DH12 Only more than 48,000. During the test, we also found that the response is a bit slow. Our step counting algorithm is the same. May I change the parameters in that respect to make the response faster.

This topic has been closed for replies.

3 replies

党靳.1
党靳.1Author
Associate II
September 23, 2021

This is our code to read the data:

int MMA845X_Run(void)

{

#if TEST_WAKEUP

return 0;

#endif

uint16_t vector_filter;

uint8_t statusReg, timeout;

short accel_3d[3];

timeout=100;

do

{

statusReg = MMA845x_ReadReg(MMA845X_STATUS);

}

while(((statusReg & 0x08) != 0x08) && (timeout-- > 0x02));

if(0 != onMMA845xReadAccel(accel_3d))

{

return -1;

}

uint16_t vector_temp=(uint16_t)sqrt(accel_3d[0]*accel_3d[0]+accel_3d[1]*accel_3d[1]+accel_3d[2]*accel_3d[2]);

vector_filter = filter(vector_temp);

Algorithm_Step_Judge(vector_filter);

return 0;

}

niccolò
ST Employee
September 28, 2021

Hi @党军 �?�​ ,

do the 2 sensor have the same configuration?

odr, full scale, filters and so on, if you want the same response you should configure them the same way

Niccolò

Eleon BORLINI
ST Employee
October 18, 2021

Hi @党军 �?�​ ,

do you have any updates about this issue?

-Eleon