Accuracy

The RTC on the AVR controller maintains high accuracy as long as the watch crystal is accurate. Asynchronous operation allows the timer to run without any delays, even when the CPU is under heavy load. However, a small negligible discrepancy does occur because the timer variables are not updated in parallel. By the time they are finished updating, they deviate from the Timer/Counter very slightly. The largest discrepancy occurs when all the timer variables are overflowed. At this moment, “second” is 59, “minute” is 59, “hour” is 23, and so on. It takes 94 cycles for the MCU to complete the update. At a 4MHz CPU clock, the error between the RTC and the watch crystal will not exceed 23.5µs found by 94/(4 * 106). A typical error should be 6µs since 24 cycles are needed to update “second”. This error does not accumulate since the Timer is always synchronous with the watch crystal.