phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3379
Posted: 01:34am 01 Oct 2025
Jim makes an important point, It can take up to 1mS to respond to the WAKEUP Pin.
Synchronizing by timing alone has limitations as the main clock is stopped and the Wake Timer accuracy is ±20%. For a 5S interval, even if it starts perfectly synchronized, it would have to wake at least 1S early to be certain of catching a set of pulses, and stay awake till they arrived. Up to 1S if it just missed a set.
Both of these accuracy problems could be reduced by first measuring the actual Wake Timer and WAKEUP Pin response time for that specific chip and saving with VAR SAVE or putting them in the code. The times could possibly be affected by temperature and supply voltage so that will need more testing.
An external timer may be more accurate but also uses some power.