Data Sheet

98
Atmel | SMART SAM D21 [DATASHEET]
Atmel-42181G–SAM-D21_Datasheet–09/2015
Refer to GENCTRL register for details.
3. The generic clock must be configured by performing a single 16-bit write to the Generic Clock Control register
(CLKCTRL):
z The generic clock that will be configured must be written to the ID bit group (CLKCTRL.ID)
z The generic clock generator used as the source of the generic clock must be written to the GEN bit group
(CLKCTRL.GEN)
Refer to CLKCTRL register for details.
14.6.2.2 Enabling, Disabling and Resetting
The GCLK module has no enable/disable bit to enable or disable the whole module.
The GCLK is reset by writing a one to the Software Reset bit in the Control register (CTRL.SWRST). All registers in the
GCLK will be reset to their initial state except for generic clocks and associated generators that have their Write Lock bit
written to one. Refer to “Configuration Lock” on page 100 for details.
14.6.2.3 Generic Clock Generator
Each generic clock generator (GCLKGEN) can be set to run from one of eight different clock sources except
GCLKGEN[1] which can be set to run from one of seven sources. GCLKGEN[1] can act as source to the other generic
clock generators but can not act as source to itself.
Each generic clock generator GCLKGEN[x] can be connected to one specific GCLK_IO[x] pin. The GCLK_IO[x] can be
set to act as source to GCLKGEN[x] or GCLK_IO[x] can be set up to output the clock generated by GCLKGEN[x].
The selected source (GCLKGENSRC see Figure 14-3) can optionally be divided. Each generic clock generator can be
independently enabled and disabled.
Each GCLKGEN clock can then be used as a clock source for the generic clock multiplexers. Each generic clock is
allocated to one or several peripherals.
GCLKGEN[0], is used as GCLK_MAIN for the synchronous clock controller inside the Power Manager.
Refer to “PM – Power Manager” on page 117 for details on the synchronous clock generation.
Figure 14-3. Generic Clock Generator
14.6.2.4 Enabling a Generic Clock Generator
A generic clock generator is enabled by writing a one to the Generic Clock Generator Enable bit in the Generic Clock
Generator Control register (GENCTRL.GENEN).
14.6.2.5 Disabling a Generic Clock Generator
A generic clock generator is disabled by writing a zero to GENCTRL.GENEN. When GENCTRL.GENEN is read as zero,
the GCLKGEN clock is disabled and clock gated.
GC
LK_I
O
[x]
D
IVIDE
R
C
loc
k
G
at
e
GC
LK
G
EN[x
]
C
lock
S
ource
s
0
1
GENCTRL.DIVSE
L
G
EN
C
TRL.
G
ENEN
G
ENDIV.DI
V
G
ENCTRL.SR
C
GC
LK
G
EN
S
R
C