I am running a loop that is constantly reading from an I2C sensor. However after a long while I notice the system hangs. When I pause the code I see it is hanging just after going into LPM0. I have included a screenshot of the situation below.
I ran three tests and found that the number of cycles differs significantly.
Test 1 - 836 cycles
Test 2 - 1892 cycles
Test 3 - 1002 cycles
One cycle is counted when the sensor has data to be read but, the sensor is polled between each full data read to see if data is available. There are approximately 44 reads per cycle and therefore 88 times the uC goes into LPM0 (once per write and once per read).
Any help in resolving this issue would be very much appreciated.
Thanks
Kas