English
Language : 

AT32AP7001_1 Datasheet, PDF (97/829 Pages) ATMEL Corporation – AVR32 32-bit Microcontroller
AT32AP7001
11.5.4.1 Selecting PLL or oscillator for the main clock
11.5.4.2
The common main clock can be connected to Oscillator 0 or PLL0. By default, the main clock will
be connected to the Oscillator 0 output. The user can connect the main clock to the PLL0 output
by writing the PLLSEL bit in the Main Clock Control Register (MCCTRL) to 1. This must only be
done after PLL0 has been enabled, otherwise a deadlock will occur. Care should also be taken
that the new frequency of the synchronous clocks does not exceed the maximum frequency for
each clock domain.
Selecting synchronous clock division ratio
11.5.4.3
The main clock feeds an 8-bit prescaler, which can be used to generate the synchronous clocks.
By default, the synchronous clocks run on the undivided main clock. The user can select a pres-
caler division for the CPU clock by writing CKSEL:CPUDIV to 1 and CPUSEL to the prescaling
value, resulting in a CPU clock frequency:
fCPU = fmain / 2(CPUSEL+1)
Similarly, the clock for HSB, PBA, and PBB can be divided by writing their respective bitfields.
To ensure correct operation, frequencies must be selected so that fCPU fHSB fPBA,B. Also, fre-
quencies must never exceed the specified maximum frequency for each clock domain.
CKSEL can be written without halting or disabling peripheral modules. Writing CKSEL allows a
new clock setting to be written to all synchronous clocks at the same time. It is possible to keep
one or more clocks unchanged by writing the same value a before to the xxxDIV and xxxSEL bit-
fields. This way, it is possible to e.g. scale CPU and HSB speed according to the required
performance, while keeping the PBA and PBB frequency constant.
Clock Ready flag
11.5.5
There is a slight delay from CKSEL is written and the new clock setting becomes effective. Dur-
ing this interval, the Clock Ready (CKRDY) flag in ISR will read as 0. If IER:CKRDY is written to
1, the Power Manager interrupt can be triggered when the new clock setting is effective. CKSEL
must not be re-written while CKRDY is 0, or the system may become unstable or hang.
Peripheral clock masking
11.5.5.1
By default, the clock for all modules are enabled, regardless of which modules are actually being
used. It is possible to disable the clock for a module in the CPU, HSB, PBA, or PBB clock
domain by writing the corresponding bit in the Clock Mask register (CPU/HSB/PBA/PBB) to 0.
When a module is not clocked, it will cease operation, and its registers cannot be read or written.
The module can be re-enabled later by writing the corresponding mask bit to 1.
A module may be connected to several clock domains, in which case it will have several mask
bits.
Table 11-1 contains a list of implemented maskable clocks.
Cautionary note
Note that clocks should only be switched off if it is certain that the module will not be used.
Switching off the clock for the internal RAM will cause a problem if the stack is mapped there.
Switching off the clock to the Power Manager (PM), which contains the mask registers, or the
corresponding PB bridge, will make it impossible to write the mask registers again. In this case,
they can only be re-enabled by a system reset.
97
32015G–AVR32–09/09