SAM D21 Generic Clock Controller (GCLK) Overview

Last modified by Microchip on 2023/11/09 09:01

Depending on the application, peripherals may require specific clock frequencies to operate correctly. The Generic Clock Controller (GCLK) provides eight Generic Clock Generators that can provide a wide range of clock frequencies.

One or more master source clocks can be selected as the input clock to a Generic Clock Generator. A clock source selected as input to a generator can either be used directly, or it can be prescaled in the generator. The outputs from the generators are used as sources for the Generic Clock Multiplexers, which provide the Generic Clock (GCLK_PERIPHERAL) to the peripheral modules, as shown in the accompanying Generic Clock Controller Block Diagram. The number of Peripheral Clocks depends on how many peripherals the device has.


Generator 0 is always the direct source of the GCLK_MAIN signal.

Generic Clock Generators

Each Generic Clock Generator within the device can source its input clock from one of the provided source clocks and prescale the output for one or more Generic Clock Channels in a one-to-many relationship. The generators thus allow for several clocks to be generated with different frequencies, power usages, and accuracies, which can be turned on and off individually to disable the clocks to multiple peripherals as a group.

Generic Clock Channels

A Generic Clock Channel is used to connect a Generic Clock Generator to a peripheral within the device. Each peripheral or peripheral group has an associated Generic Clock Channel, which serves as the clock input for the peripheral(s). To supply a clock to the peripheral module(s), the associated channel must be connected to a running Generic Clock Generator and the channel enabled.