cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH12 sensor - strange 1.6 second long sawtooth pattern in reading times

Tim9
Visitor

I am using an LIS2DH12 sensor with an esp8266 via I2C. It is the only sensor on I2C. I have a process loop that repeats every 200ms. During this loop, it is recording some other pin inputs and analog inputs, and sending the data to another esp8266 via serial.

 

With the LIS sensor commented out, the maximum loop time is 5ms.

With the LIS sensor reading active, and reading it every 200ms, the maximum loop time including the LIS reading varies from 10ms-45ms. So the LIS reading is taking between 5-40ms.

 

My question: There is a strange pattern over the span of 1.6 seconds. Consistently the loop time progresses 45-41-36-31-26-21-16-11ms, only to repeat again 45-41-36-31-26-21-16-11ms.

What is causing this pattern? Is the sensor itself doing something in this 1.6 second time period?

Thanks!

0 REPLIES 0