Crystal Error Correction

The prescaler for the RTC and PIT can do internal correction (when CORREN bit in RTC.CTRLA is ‘1’) on the crystal clock by taking the PPM error value from the CALIB register.

The CALIB register must be written by the user based on information about the frequency error. Correction is done within an interval of approximately 1 million cycles of the input clock. The correction operation is performed by adding or removing one cycle. These single-cycle operations will be performed repeatedly the error number of times (ERROR bits in RTC.CALIB) spread throughout the 1 million cycle correction interval.

The correction of the clock will be reflected in the RTC count value available through the RTC.CNTx registers or in the PIT intervals.

If disabling the correction feature, an ongoing correction cycle will be completed before the function is disabled.