Datasheet

523
SAM3X / SAM3A [DATASHEET]
Atmel-11057C-ATARM-SAM3X-SAM3A-Datasheet_23-Mar-15
When disabling the Main Clock by clearing the MOSCRCEN bit in CKGR_MOR, the MOSCRCS bit in the Power
Management Controller Status Register (PMC_SR) is automatically cleared, indicating the Main Clock is off.
Setting the MOSCRCS bit in the Power Management Controller Interrupt Enable Register (PMC_IER) can trigger
an interrupt to the processor.
It is recommended to disable the Main Clock as soon as the processor no longer uses it and runs out of SLCK,
PLLACKor UPLLCK.
The CAL4, CAL8 and CAL12 values in the PMC Oscillator Calibration Register (PMC_OCR) are the default values
set by Atmel during production. These values are stored in a specific Flash memory area different from the main
memory plane. These values cannot be modified by the user and cannot be erased by a Flash erase command or
by the ERASE pin. Values written by the user's application in PMC_OCR are reset after each power up or
peripheral reset.
27.5.2 3 to 20 MHz Crystal or Ceramic Resonator-based Oscillator
After reset, the 3 to 20 MHz Crystal or Ceramic Resonator-based oscillator is disabled and it is not selected as the
source of MAINCK.
The user can select the 3 to 20 MHz Crystal or Ceramic Resonator-based oscillator to be the source of MAINCK,
as it provides a more accurate frequency. The software enables or disables the main oscillator so as to reduce
power consumption by clearing the MOSCXTEN bit in the Main Oscillator Register (CKGR_MOR).
When disabling the main oscillator by clearing the MOSCXTEN bit in CKGR_MOR, the MOSCXTS bit in PMC_SR
is automatically cleared, indicating the Main Clock is off.
When enabling the main oscillator, the user must initiate the main oscillator counter with a value corresponding to
the startup time of the oscillator. This startup time depends on the crystal frequency connected to the oscillator.
When the MOSCXTEN bit and the MOSCXTCNT are written in CKGR_MOR to enable the main oscillator, the XIN
and XOUT pins are automatically switched into oscillator mode and MOSCXTS bit in the Power Management
Controller Status Register (PMC_SR) is cleared and the counter starts counting down on the slow clock divided by
8 from the MOSCXTCNT value. Since the MOSCXTCNT value is coded with 8 bits, the maximum startup time is
about 62 ms.
When the counter reaches 0, the MOSCXTS bit is set, indicating that the main clock is valid. Setting the
MOSCXTS bit in PMC_IMR can trigger an interrupt to the processor.
27.5.3 Main Clock Oscillator Selection
The user can select either the 4/8/12 MHz Fast RC oscillator or the 3 to 20 MHz Crystal or Ceramic Resonator-
based oscillator to be the source of Main Clock.
The advantage of the 4/8/12 MHz Fast RC oscillator is that it provides fast startup time, this is why it is selected by
default (to start up the system) and when entering Wait Mode.
The advantage of the 3 to 20 MHz Crystal or Ceramic Resonator-based oscillator is that it is very accurate.
The selection is made by writing the MOSCSEL bit in the Main Oscillator Register (CKGR_MOR). The switch of
the Main Clock source is glitch free, so there is no need to run out of SLCK, PLLACKor UPLLCK in order to change
the selection. The MOSCSELS bit of the Power Management Controller Status Register (PMC_SR) allows
knowing when the switch sequence is done.
Setting the MOSCSELS bit in PMC_IMR can trigger an interrupt to the processor.