543
SAM4CP [DATASHEET]
43051E–ATPL–08/14
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, PLLACK, PLLBCK. 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
values (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.
Enable the Peripheral Clocks:
9.
Once all of the previous steps have been completed, the peripheral clocks can be enabled and/or disabled via
registers PMC_PCER0, PMC_PCER, PMC_PCDR0 and PMC_PCDR.
30.16 Clock Switching Details
30.16.1 Master Clock Switching Timings
Table 30-1
and give the worst case timings required for the Master Clock to switch from one selected clock to another
one. This is in the event that the prescaler is de-activated. When the prescaler is activated, an additional time of 64 clock
cycles of the newly selected clock has to be added.
Notes: 1.
PLL designates either the PLLA or the PLLB Clock.
PLLCOUNT designates either PLLACOUNT or PLLBCOUNT.
2.
Table 30-1.
Clock Switching Timings (Worst Case)
From
Main Clock
SLCK
PLL Clock
To
Main Clock
–
4 x SLCK +
2.5 x Main Clock
3 x PLL Clock +
4 x SLCK +
1 x Main Clock
SLCK
0.5 x Main Clock +
4.5 x SLCK
–
3 x PLL Clock +
5 x SLCK
PLL Clock
0.5 x Main Clock +
4 x SLCK +
PLLCOUNT x SLCK +
2.5 x PLLx Clock
2.5 x PLL Clock +
5 x SLCK +
PLLCOUNT x SLCK
2.5 x PLL Clock +
4 x SLCK +
PLLCOUNT x SLCK