mcci-catena / Catena-Arduino-Platform

Arduino platform library for MCCI Catena IoT Systems
MIT License
12 stars 11 forks source link

Real-Time Sleep is short on Catena 4612 / 16 MHz #129

Closed terrillmoore closed 5 years ago

terrillmoore commented 5 years ago

I'm testing Catena4612_simple.ino. After boot, it does 10 messages on a 30 second cycle, then switches to a 360 second cycle.

The sleeps end up being short -- 360 seconds is the target, but the device sleeps for about 300 seconds. That's about 20% fast.

In fact, the shorter sleeps are also too fast (instead of 30 seconds, we see about 24 seconds).

I have to open up the LMIC window by setting the clock accuracy to 10% (which wastes power, a little) on this platform as well. My guess is that something really is off by 20% (some scaling factor for the clock, either hardware or software).

I have not investigated whether light sleep (using the micros() or millis() timer) is similarly inaccurate. If so, it's a problem for measurements of pulse streams.

Testing is being done with 16MHz clock, no USB.