538
SAM4CP [DATASHEET]
43051E–ATPL–08/14
If the peripherals located on the coprocessor system bus require data exchange with the co-processor or the main
processor, the CPBMCK clock must be enabled prior to enable any co-processor peripheral clock.
When a peripheral clock is disabled, the clock is immediately stopped. The peripheral clocks are automatically disabled
after a reset.
To stop a peripheral, it is recommended that the system software wait until the peripheral has executed its last
programmed operation before disabling the clock. This is to avoid data corruption or erroneous behavior of the system.
The bit number within the Peripheral Clock Control registers (PMC_PCER0-1, PMC_PCDR0-1, and PMC_PCSR0-1) is
the Peripheral Identifier defined at the product level. The bit number corresponds to the interrupt source number
assigned to the peripheral.
30.8
Free Running Processor Clock
The Free Running Processor Clock (FCLK) together with the Free Running Coprocessor Master Clock (CPFCLK) used
for sampling interrupts and clocking debug blocks ensures that interrupts can be sampled, and sleep events can be
traced, while the processor(s) is(are) sleeping. It is connected to Master Clock (MCK)/Coprocessor Master Clock
(CPMCK).
30.9
Programmable Clock Output Controller
The PMC controls 3 signals to be output on external pins, PCKx. Each signal can be independently programmed via the
Programmable Clock Registers (PMC_PCKx).
PCKx can be independently selected between the Slow Clock (SLCK), the Main Clock (MAINCK), the PLLA Clock
(PLLACK), the PLLB Clock (PLLBCK), and the Master Clock (MCK) by writing the CSS field in PMC_PCKx. Each output
signal can also be divided by a power of 2 between 1 and 64 by writing the PRES (Prescaler) field in PMC_PCKx.
Each output signal can be enabled and disabled by writing 1 in the corresponding bit, PCKx of PMC_SCER and
PMC_SCDR, respectively. Status of the active programmable output clocks are given in the PCKx bits of PMC_SCSR
(System Clock Status Register).
PCKRDYx status flag in PMC_SR indicates that the Programmable Clock is actually what has been programmed in the
Programmable Clock registers.
As the Programmable Clock Controller does not manage with glitch prevention when switching clocks, it is strongly
recommended to disable the Programmable Clock before any configuration change and to re-enable it after the change
is actually performed.
30.10 Main Processor Fast Startup
The device allows the main processor to restart in less than 10 microseconds while the device exits Wait Mode only if the
C-code function managing the wait mode entry and exit is linked to and executed from on-chip SRAM.
The fast startup time cannot be achieved if the first instruction after an exit is located in the embedded Flash. If fast
startup is not required or if the first instruction after a wait mode exit is located in embedded Flash, see
Section 30.11
”Main Processor Startup from Embedded Flash”
.
Prior to instructing the device to enter wait mode, the Fast RC oscillator must be selected as the master clock source (the
CSS field in PMC_MCKR must be written to 1) and the internal sources of wake-up must be cleared. It must be verified
that none of the enabled external wake-up inputs (WKUP) hold an active polarity.
The system enters Wait Mode either by setting the WAITMODE bit in CKGR_MOR, or by executing the WaitForEvent
(WFE) instruction of the processor while the LPM bit is at 1 in PMC_FSMR. Immediately after setting the WAITMODE bit
or using the WFE instruction, wait for the MCKRDY bit to be set in PMC_SR.
In case of dual core activity, it is recommended to check the coprocessor state before instructing the main processor to
enter Wait Mode.