
438
SAM G51 [DATASHEET]
11209C–ATARM–20-Dec-13
While PLLx is unlocked, the master clock selection is automatically changed to slow clock for PLLA. For further
Code Example:
write_register(PMC_MCKR,0x00000001)
wait (MCKRDY=1)
write_register(PMC_MCKR,0x00000011)
wait (MCKRDY=1)
The master clock is main clock divided by 2.
8.
Select the programmable clocks
Programmable clocks are controlled via registers, PMC_SCER, PMC_SCDR and PMC_SCSR.
Programmable clocks can be enabled and/or disabled via PMC_SCER and PMC_SCDR. Three programmable
clocks can be used. PMC_SCSR indicates which programmable clock is enabled. By default all programmable
clocks are disabled.
PMC_PCKx registers are used to configure programmable clocks.
The CSS field is used to select the programmable clock divider source. Several clock options are available: main
clock, slow clock, master clock, PLLACK, . The slow clock is the default clock source.
The PRES field is used to control the programmable clock prescaler. It is possible to choose between different val-
ues (1, 2, 4, 8, 16, 32, 64). Programmable clock output is prescaler input divided by PRES parameter. By default,
the PRES value is set to 0 which means that PCKx is equal to slow clock.
Once PMC_PCKx register has been configured, the corresponding programmable clock must be enabled and the
user is constrained to wait for the PCKRDYx bit to be set in the PMC_SR. This can be done either by polling
PCKRDYx in PMC_SR or by waiting for the interrupt line to be raised if the associated interrupt source
(PCKRDYx) has been enabled in PMC_IER. All parameters in PMC_PCKx can be programmed in a single write
operation.
If the CSS and PRES parameters are to be modified, the corresponding programmable clock must be disabled
first. The parameters can then be modified. Once this has been done, the user must re-enable the programmable
clock and wait for the PCKRDYx bit to be set.
9.
Enable the peripheral clocks
Once all of the previous steps have been completed, the peripheral clocks can be enabled and/or disabled via reg-
isters PMC_PCER0, PMC_PCDR0.