Page 1 of 1

what's the best way to achieve a periodic timer, with deep sleep in between

Posted: Fri Jul 07, 2023 9:16 am
by trustmiao
In the project, we plan to build a periodic timer to send a lora message, and sleep between the timer. For now our solution is record the time sending last message, start a timer after wakeup based on calculation of time difference. but there will couple us difference every time(4-10us), therefore the timer won't work accurately for long duration. What's the best way to achieve this ? Thank in advance.

Re: what's the best way to achieve a periodic timer, with deep sleep in between

Posted: Fri Jul 07, 2023 9:26 am
by trustmiao
one interesting finding is, every time eps32 deep sleeps, the "gettimeofday" though continuous to give time, but it will miss around 50ms , make two device time not synced.