17.6.2.4. Selecting the Synchronous Clock Division Ratio
The main clock GCLK_MAIN 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
prescaler division for the CPU clock domain by writing the Division (DIV) bits in the CPU Clock Division
register CPUDIV, resulting in a CPU clock domain frequency determined by this equation:
�
���
=
�
����
������
Similarly, the clock for the Backup Clock Domain can be divided by writing the BUPDIV register. To
ensure correct operation, frequencies must be selected so that f
CPU
≥ f
BUP
. Also, frequencies must never
exceed the specified maximum frequency for each clock domain given in the electrical characteristics
specifications.
If the application attempts to write forbidden values in CPUDIV or BUPDIV registers, registers are written
but these bad values are not used and a violation is reported to the PAC module.
Division bits (DIV) can be written without halting or disabling peripheral modules. Writing DIV bits allows a
new clock setting to be written to all synchronous clocks belonging to the corresponding clock domain at
the same time. Each clock domain can be changed without changing others. This way, it is possible to, for
example, scale the CPU clock domain speed according to the required performance, while keeping the
Backup Clock Domain frequency constant.
Figure 17-2. Synchronous Clock Selection and Prescaler
Prescaler
Sleep Controller
Sleep mode
BUPDIV
CPUDIV
CLK_CPU
GCLK
GCLK_MAIN
Clock
gate
Clock
gate
Clock
gate
CLK_AHB_HS
clk_ahb_ip0
clk_ahb_ip1
clk_ahb_ipn
Clock
gate
Clock
gate
CLK_APB_HS
clk_apb_ip0
clk_apb_ip1
clk_apb_ipn
Clock
gate
Clock
gate
PERIPHERALS
CPU
Clock
gate
Clock
gate
CLK_APBx
clk_apb_ip0
clk_apb_ip1
clk_apb_ipn
Clock
gate
Clock
gate
MASK
PERIPHERALS
Backup
Clock Domain: fBUP
CPU
Clock Domain: f
CPU
MASK
MASK
Related Links
PAC - Peripheral Access Controller
on page 50
on page 1147
17.6.2.5. Clock Ready Flag
There is a slight delay between writing to CPUDIV and BUPDIV until the new clock settings become
effective.
Atmel SAM L22G / L22J / L22N [DATASHEET]
Atmel-42402E-SAM L22G / L22J / L22N_Datasheet_Complete-07/2016
144