Datasheet

577
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
29.5.2 Fast RC Oscillator Clock Frequency Adjustment
It is possible for the user to adjust the main RC oscillator frequency through PMC_OCR. By default, SEL4/8/12 are
low, so the RC oscillator will be driven with Flash calibration bits which are programmed during chip production.
The user can adjust the trimming of the 4/8/12 MHz fast RC oscillator through this register in order to obtain more
accurate frequency (to compensate derating factors such as temperature and voltage).
In order to calibrate the oscillator lower frequency, SEL must be set to 1 and a good frequency value must be
configured in CAL4. Likewise, SEL8/12 must be set to 1 and a trim value must be configured in CAL8/12 in order
to adjust the other frequencies of the oscillator.
However, the adjustment can not be done to the frequency from which the oscillator is operating. For example,
while running from the lower possible frequency, the user can adjust the other frequencies but not the lowest one.
It is possible to restart, at anytime, a measurement of the main frequency by means of the RCMEAS bit in Main
Clock Frequency Register (CKGR_MCFR). Thus, when MAINFRDY flag reads 1, another read access on
CKGR_MCFR provides an image of the frequency of the main clock on MAINF field. The software can calculate
the error with an expected frequency and correct the CAL (or CAL8/CAL12) field accordingly. This may be used to
compensate frequency drift due to derating factors such as temperature and/or voltage.