Atmel Xplained Pro Evaluation Kit ATSAM4E-XPRO ATSAM4E-XPRO Data Sheet

Product codes
ATSAM4E-XPRO
Page of 1506
579
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
29.5.4   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 start-up time, this is why it is selected by
default (to start 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 CKGR_MOR. The switch of the main clock source is glitch
free, so there is no need to run out of SLCK, PLLACK in order to change the selection. The MOSCSELS bit of
PMC_SR indicates when the switch sequence is done.
Setting the MOSCSELS bit in PMC_IMR can trigger an interrupt to the processor.
Enabling the fast RC oscillator (MOSCRCEN = 1) and changing the fast RC frequency (MOSCCRF) at the same
time is not allowed.
The fast RC must be enabled first and its frequency changed in a second step.