9.2 Enabling a Peripheral
Configuring a peripheral that relies on an asynchronous clock requires the following Generic Clock Controller (GCLK) configuration:
- A clock from the Generic Clock Generator must be configured to use one of the running Clock Sources, and the Generator must be enabled
- The Peripheral Channel that provides the Generic Clock signal to the peripheral must be configured to use a running Generic Clock Generator, and the Generic Clock must be enabled
- A synchronous clock provided by the Main Clock Controller (MCLK) is also required to configure the peripheral user interface
This results in the following registers configuration:
- The source oscillator for a generic clock generator 'n' is selected by writing to the Source bit field in the Generator Control n register (GCLK.GENCTRLn.SRC).
- A Peripheral Channel ‘m’ can be configured to use a specific Generic Clock Generator by writing to the Generic Clock Generator bit field in the respective Peripheral Channel m register (GCLK.PCHCTRLm.GEN)
Note: The Peripheral Channel number, m, is fixed for a given peripheral. See the
Mapping table in the description of GCLK.PCHCTRLm.
All synchronous peripheral clocks are by default enabled after reset (MCLK.AHBMASK, MCLK.APBxMASK).