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
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
504
̶
If MOSCSELS = 1, there is a valid crystal connected and its frequency can be determined by initiating 
a frequency measure by programming RCMEAS in the CKGR_MCFR register.
̶
If MOSCSELS = 0, there is no fast crystal clock (either no crystal connected or a crystal clock out of 
specification).
A frequency measure can reinforce this status by initiating a frequency measure by programming 
RCMEAS in the CKGR_MCFR register.
̶
If MOSCSELS=0, the selection of the main clock must be programmed back to the main RC oscillator 
by writing MOSCSEL to 0 prior to disabling the fast crystal oscillator.
̶
If MOSCSELS=0, the crystal oscillator can be disabled (MOSCXTEN=0 in the CKGR_MOR register).
28.5.7 Main Clock Frequency Counter
The device features a main clock frequency counter that provides the frequency of the main clock. 
The main clock frequency counter is reset and starts incrementing at the main clock speed after the next rising 
edge of the slow clock in the following cases:
When the 4/8/12 MHz fast RC oscillator clock is selected as the source of main clock and when this 
oscillator becomes stable (i.e., when the MOSCRCS bit is set)
When the 3 to 20 MHz crystal or ceramic resonator-based oscillator is selected as the source of main clock 
and when this oscillator becomes stable (i.e., when the MOSCXTS bit is set)
When the main clock oscillator selection is modified
When the RCMEAS bit of CKGR_MFCR is written to 1.
Then, at the 16th falling edge of slow clock, the MAINFRDY bit in the Clock Generator Main Clock Frequency 
Register (CKGR_MCFR) is set and the counter stops counting. Its value can be read in the MAINF field of 
CKGR_MCFR and gives the number of main clock cycles during 16 periods of slow clock, so that the frequency of 
the 4/8/12 MHz fast RC oscillator or 3 to 20 MHz crystal or ceramic resonator-based oscillator can be determined.