Atmel ARM-Based Evaluation Kit for SAM4S16C, 32-Bit ARM® Cortex® Microcontroller ATSAM4S-WPIR-RD ATSAM4S-WPIR-RD Data Sheet

Product codes
ATSAM4S-WPIR-RD
Page of 1231
299
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
16.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 two correction events differs.
The inaccuracy of a crystal oscillator at typical room temperature (±20 ppm at 20–25 degrees Celsius) 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_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.
16.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 outputs (RTCOUT0 and RTCOUT1) have a source driver selected among seven possibilities.