289
SAM4CP [DATASHEET]
43051E–ATPL–08/14
17.5.7 RTC Accurate Clock Calibration
The crystal oscillator that drives the RTC may not be as accurate as expected mainly due to temperature variation.
The RTC is equipped with circuitry able to correct slow clock crystal drift.
To compensate for possible temperature variations over time, this accurate clock calibration circuitry can be programmed
on-the-fly and also programmed during application manufacturing, in order to correct the crystal frequency accuracy
at room temperature (20-25°C). The typical clock drift range at room temperature is ±20 ppm.
In the device operating temperature range, the 32.768 kHz crystal oscillator clock inaccuracy can be up to -200 ppm.
The RTC clock calibration circuitry allows positive or negative correction in a range of 1.5 ppm to 1950 ppm.
After correction, the remaining crystal drift is as follows:
Below 1 ppm, for an initial crystal drift between 1.5 ppm up to 90 ppm
Below 2 ppm, for an initial crystal drift between 90 ppm up to 130 ppm
Below 5 ppm, for an initial crystal drift between 130 ppm up to 200 ppm
The calibration circuitry acts by slightly modifying the 1 Hz clock period from time to time. When the period is modified,
depending on the sign of the correction, the 1 Hz clock period increases or reduces by around 4 ms. According to the
CORRECTION, NEGPPM and HIGHPPM values configured in the RTC Mode Register (RTC_MR), the period interval
between 2 correction events differs.
The inaccuracy of a crystal oscillator at typical room temperature (±20 ppm at 20-25 oC) can be compensated if a
reference clock/signal is used to measure such inaccuracy. This kind of calibration operation can be set up during the
final product manufacturing by means of measurement equipment embedding such a reference clock. The correction of
value must be programmed into the RTC Mode Register (RTC_MR), and this value is kept as long as the circuitry is
powered (backup area). Removing the backup power supply cancels this calibration. This room temperature calibration
can be further processed by means of the networking capability of the target application.
To ease the comparison of the inherent crystal accuracy with the reference clock/signal during manufacturing, an internal
prescaled 32.768 kHz clock derivative signal can be assigned to drive RTC output. To accommodate the measure,
several clock frequencies can be selected among 1 Hz, 32 Hz, 64 Hz, 512 Hz.
In any event, this adjustment does not take into account the temperature variation.
The frequency drift (up to -200 ppm) due to temperature variation can be compensated using a reference time if the
application can access such a reference. If a reference time cannot be used, a temperature sensor can be placed close
to the crystal oscillator in order to get the operating temperature of the crystal oscillator. Once obtained, the temperature
may be converted using a lookup table (describing the accuracy/temperature curve of the crystal oscillator used) and
RTC_MR configured accordingly. The calibration can be performed on-the-fly. This adjustment method is not based on
a measurement of the crystal frequency/drift and therefore can be improved by means of the networking capability of the
target application.
If no crystal frequency adjustment has been done during manufacturing, it is still possible to do it. In the case where
a reference time of the day can be obtained through LAN/WAN network, it is possible to calculate the drift of the
application crystal oscillator by comparing the values read on RTC Time Register (RTC_TIMR) and programming the
HIGHPPM and CORRECTION fields on RTC_MR according to the difference measured between the reference time and
those of RTC_TIMR.
17.5.8 Waveform Generation
Waveforms can be generated by the RTC in order to take advantage of the RTC inherent prescalers while the RTC is the
only powered circuitry (low-power mode of operation, backup mode) or in any active modes. Going into backup or low
power operating modes does not affect the waveform generation outputs.
The RTC output (RTCOUT0) has a source driver selected among 7 possibilities.
The first selection choice sticks the associated output at 0 (This is the reset value and it can be used at any time to
disable the waveform generation).
Selection choices 1 to 4 respectively select 1 Hz, 32 Hz, 64 Hz and 512 Hz.