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

Product codes
ATSAM4E-XPRO
Page of 1506
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
582
29.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 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.