• Ok, great - I just filed an issue at https://github.com/espruino/Espruino/iss­ues/2005 so hopefully we can get that fixed at some point.

    There's no specific documentation on the calibration phase as far as I remember, but basically:

    The real time clock only runs at 32kHz, which means if you're trying to measure pulse widths, you'll bump into problems with accuracy pretty quickly... So we use the 'System Tick' timer which runs at the same speed as the processor - but we want the two to keep in sync (neither is 100% accurate).

    There's some code which keeps track of how many System Ticks there are for each tick of the RTC, so that when you ask for the time it can look at the system time and work back to a high res value, but in RTC time. It just takes a few seconds to figure out exactly what that should be...

About

Avatar for Gordon @Gordon started