17.5.7. Debug Operation
When the CPU is halted in debug mode, the MCLK continues normal operation. In sleep mode, the clocks
generated from the MCLK are kept running to allow the debugger accessing any module. As a
consequence, power measurements are incorrect in debug mode.
17.5.8. Register Access Protection
All registers with write-access can be write-protected optionally by the Peripheral Access Controller
(PAC), except the following registers:
•
Interrupt Flag register (INTFLAG)
Optional write-protection by the Peripheral Access Controller (PAC) is denoted by the "PAC Write-
Protection" property in each individual register description.
PAC write-protection does not apply to accesses through an external debugger.
Related Links
PAC - Peripheral Access Controller
on page 50
17.5.9. Analog Connections
Not applicable.
17.6. Functional Description
17.6.1. Principle of Operation
The GCLK_MAIN clock signal from the GCLK module is the source for the main clock, which in turn is the
common root for the synchronous clocks for the CPU, APBx, and AHBx modules. The GCLK_MAIN is
divided by an 8-bit prescaler. Each of the derived clocks can run from any divided or undivided main
clock, ensuring synchronous clock sources for each clock domain. Each clock domain (CPU, BUP) can
be changed on the fly to respond to variable load in the application as long as f
CPU
≥ f
BUP
. The clocks for
each module in a clock domain can be masked individually to avoid power consumption in inactive
modules. Depending on the sleep mode, some clock domains can be turned off.
17.6.2. Basic Operation
17.6.2.1. Initialization
After a Reset, the default clock source of the GCLK_MAIN clock is started and calibrated before the CPU
starts running. The GCLK_MAIN clock is selected as the main clock without any prescaler division.
By default, only the necessary clocks are enabled.
Related Links
on page 145
17.6.2.2. Enabling, Disabling, and Resetting
The MCLK module is always enabled and cannot be reset.
17.6.2.3. Selecting the Main Clock Source
Refer to the Generic Clock Controller description for details on how to configure the clock source of the
GCLK_MAIN clock.
Related Links
GCLK - Generic Clock Controller
on page 121
Atmel SAM L22G / L22J / L22N [DATASHEET]
Atmel-42402E-SAM L22G / L22J / L22N_Datasheet_Complete-07/2016
143