12.2.1 Block Diagram

Figure 12-1. CLKCTRL Block Diagram

The clock system consists of the main clock and clocks derived from the main clock, as well as several asynchronous clocks:
  • Main Clock (CLK_MAIN) is always running in Active and Idle sleep modes. If requested, it will also run in Standby sleep mode.
  • CLK_MAIN is prescaled and distributed by the clock controller:
    • CLK_CPU is used by the CPU, SRAM and the Nonvolatile Memory Controller (NVMCTRL) peripheral
    • CLK_PER is used by all peripherals not listed under asynchronous clocks and can also be routed to the CLKOUT pin
    • All the clock sources can be used as the main clock
  • Clocks running asynchronously to the main clock domain:
    • CLK_RTC is used by the Real-Time Counter (RTC) and the Periodic Interrupt Timer (PIT). It will be requested when the RTC/PIT is enabled. The CLK_RTC clock source may be changed only if the peripheral is disabled.
    • CLK_WDT is used by the Watchdog Timer (WDT). It will be requested when the WDT is enabled.
    • CLK_BOD is used by the Brown-out Detector (BOD). It will be requested when the BOD is enabled in Sampled mode. A fuse controls the alternative clock source.
    • CLK_USB is used by the Universal Serial Bus (USB) peripheral. It will be requested when the USB is enabled.
    • Clock Failure Detector (CFD) is an asynchronous mechanism to detect a failure on an external crystal or clock source

The clock source for the main clock domain is configured by writing to the Clock Select (CLKSEL) bit field in the Main Clock Control A (CLKCTRL.MCLKCTRLA) register. This register has Configuration Change Protection (CCP), and the appropriate key must be written to the CCP register before writing to the CLKSEL bit field. The registers in the respective peripheral configure the asynchronous clock sources.