9.4 SERCOM Clocking Example

The figure below shows an example where SERCOM0 is clocked by OSCHF. OSCHF is enabled, Generic Clock Generator 1 uses OSCHF as its clock source, and feeds into Peripheral Channel 7. Generic Clock Peripheral Channel 7 connects to SERCOM0. The SERCOM0 interface, clocked by CLK_SERCOM0_APB, has been unmasked in the corresponding clock mask register in the MCLK module.

To customize the clock distribution, refer to the following registers and bit fields:

  • The source oscillator for a Generic Clock Generator n (GCLK_GEN[n]) is selected by writing to the Source bit field in the Generator Control n register (GENCTRLn.SRC) in the GCLK peripheral
  • 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 (PCHCTRLm.GEN) in the GCLK peripheral
  • The Peripheral Channel number m is fixed for a given peripheral. See the Mapping table in the description of the PCHCTRLm register in the GCLK chapter.
  • The APB and AHB clocks are enabled or disabled by writing to the respective bits in the clock masking registers in the Main Clock peripheral (MCLK.xxxMASK). See the MCLK - Main Clock chapter for details.
Figure 9-2. Example of SERCOM Clock