
430
SAM G51 [DATASHEET]
11209C–ATARM–20-Dec-13
22.6
Divider and PLL Block
The device features one divider/one PLL block that permits a wide range of frequencies to be selected on either the
master clock, the processor clock or the programmable clock outputs.
Figure 22-4 shows the block diagram of the
dividers and PLL blocks.
Figure 22-4.
PLL Block Diagram
22.6.1 Phase Lock Loop Programming
The PLL (PLLA) allows multiplication of the SLCK clock source. The PLL clock signal has a frequency that depends on
the respective source signal frequency and MUL (MULA). The factor applied to the source signal frequency is MUL + 1.
When MUL is written to 0or PLLAEN=0,the PLL is disabled and its power consumption is saved. Re-enabling the PLL
can be performed by writing a value higher than 0 in the MUL field and PLLAEN higher than 0.
To change the frequency of the PLLA, the PLLA must be first disabled by writing 0 in MULA field and 0 in PLLACOUNT
field. Then, the PLLA can be configured to generate the new frequency by programming a new multiplier in MULA and
the PLLACOUNT field in the same register access. See electrical characteristics to get the PLLACOUNT values covering
the PLL transient time.
Whenever the PLL is re-enabled or one of its parameters is changed, the LOCK (LOCKA) bit in PMC_SR is automatically
cleared. The values written in the PLLCOUNT field (PLLACOUNT) in CKGR_PLLR (CKGR_PLLAR) are loaded in the
PLL counter. The PLL counter then decrements at the speed of the slow clock until it reaches 0. At this time, the LOCK
bit is set in PMC_SR and can trigger an interrupt to the processor. The user has to load the number of slow clock cycles
required to cover the PLL transient time into the PLLCOUNT field.
The PLL clock can be divided by 2 by writing the PLLDIV2 (PLLADIV2) bit in PMC_MCKR.
To avoid programming the PLL with a multiplication factor that is too high, the user can saturate the multiplication factor
value sent to the PLL by setting the PLLA_MMAX field in PMC_PMMR.
It is forbidden to change the 8/16/24 MHz fast RC oscillator, or the main selection in CKGR_MOR while the master clock
source is the PLL and the PLL reference clock is the fast RC oscillator.
The user must:
Switch on the main RC oscillator by writing 1 in CSS field of PMC_MCKR.
Change the frequency (MOSCRCF) or oscillator selection (MOSCSEL) in CKGR_MOR.
Wait for MOSCRCS (if frequency changes) or MOSCSELS (if oscillator selection changes) in PMC_SR.
Disable and then enable the PLL (LOCK in PMC_IDR and PMC_IER).
Wait for LOCK flag in PMC_SR.
Switch back to PLL by writing the appropriate value to CSS field of PMC_MCKR.
PLLA
MULA
PLLACOUNT
LOCKA
SLCK
PLLACK
PLLA
Counter
SLCK
CKGR_PLLAR
PMC_SR
CKGR_PLLAR