Every Processor Expert project uses at least one clock configuration to set main system clock's configuration and distribution. However, it is possible to predefine up to eight (in case of Speed modes it was up to three ones) different timing schemes and switch between them during runtime by SetClockConfiguration() CPU (processor) method call. This is useful in case of low-power oriented applications as there can be separate high-speed (when fast computation is needed) and low-power timing schemes (when chip goes idle) and application can easily switch between them.
The following example is a use case of simple battery-powered application which will use two clock configurations. In this scenario, the application will put the microcontroller in low-power state, waiting for external or internal event (such as button push or internal timer overflow). When the event occurs, microcontroller is switched to high-speed mode to make a measurement, computation and communication with external devices. When the job is done, microcontroller is switched back to sleep.
The figure below shows situation when application runs, the microcontroller is clocked from an external source, the reference clock is processed by internal clock circuits (for example, clock frequency is increased by PLL module) and distributed across system. Core and IP 1 run from divided output of internal clock generator (data computation and communication interface handling) whether IP 2 runs directly from external reference clock (for example, because frequency from clock generator output is out of admissible range of this peripheral). Internal reference clock and IP 3 are not used therefore are powered down.
The next schematic shows low-power configuration, an internal clock reference is used instead of external as it spends less energy. No computation power is needed nor any peripheral that would need high speed clocks enabled, therefore core is powered off along with the clock generator circuits. Only IP 2 and IP 3 are enabled and clocked directly from the internal clock source, waiting for event that will bring the microcontroller back to operational mode.
This example also shows that some peripherals allow using multiple clock sources (for instance clock generator output, raw output from reference clock source or other alternative clocks). Clock configuration in such case can be used to switch clock source of the peripheral clock input. Furthermore, the example demonstrates possibility to enable or shut down entire peripheral during clock configuration switch. For more information about clock configuration options available in the embedded components, see Support of clock configurations in embedded components topic. Clock configuration switch is explained in Changing active clock configuration topic.