9.2 Clock System Features

The PIC32CM6408PL10 clock distribution system features are as follows:

  • Clock sources (oscillators) controlled by OSCCTRL and OSC32KCTRL:
    • A clock source provides a time base that is used by other modules, such as the Generic Clock Generators. Examples of clock sources include the internal high-frequency oscillator (OSCHF) and the external 32.768 kHz oscillator (XOSC32K).
  • Generic Clock Controller (GCLK), which generates, controls, and distributes asynchronous clocks, consisting of:
    • Generic Clock Generators: These contain programmable prescalers that can use any of the system clock sources. See the GCLK - Generic Clock Controller chapter for the number of available GCLK Generators. Any of the GCLK Generators (GCLK_GENn) can be sent to peripherals as needed. Generic Clock Generator 0 (GCLK_GEN0) generates the clock signal GCLK_MAIN, which is the only clock source for the Main Clock module.
    • Generic Clocks: These are the clock signals generated by the Generic Clock Generators and are typically the clock inputs for the peripherals of the system, also known as Peripheral Clocks (GCLK_PERIPH[n]). The Generic Clocks, through the Generic Clock Multiplexer, can use any of the Generic Clock Generators as their clock source. Multiple instances of a peripheral will typically have a separate Generic Clock (GCLK_PERIPH[n]) for each instance.
  • Main Clock (MCLK):
    • The MCLK module generates and controls the synchronous clocks for the system. This includes the CPU, the bus clocks Advanced Peripheral Bus (APB) and Advanced High-Speed Bus (AHB), as well as the registers of the peripherals. For the PIC32CM6408PL10, all system clocks are derived from GCLK Generator 0 (GCLK_GEN0/GCLK_MAIN).
    • The system clocks can be prescaled using the CPU Clock Division register (MCLK.CPUDIV). All system clocks will be prescaled with the same prescaler.
    • When a peripheral that interfaces with the system clock (synchronous clock) is disabled, it automatically gates off the system clock.
    • The user can mask the system clock from a peripheral using the MCLK masking registers (MCLK.xxxMASK). See the MCLK - Main Clock chapter for details.

All clock sources are routed to the Generic Clock Controller (GCLK). The GCLK distributes clock signals from the clock sources to the Main Clock Controller and most peripherals. Some peripherals take clock signals directly from the clock sources. Refer to the GCLK – Generic Clock Controller section for details on the number of available GCLK instances. Any GCLK instance can be used to clock any peripheral, while MCLK always uses GCLK0 as its clock source (GCLK_GEN0/GCLK_MAIN).