9.8 On-Demand Clock Requests
All clock sources in the system can operate in On-Demand mode, where the clock source is stopped when no peripherals are requesting it. Clock requests propagate from the peripheral, through the GCLK, to the clock source. If one or more peripherals are using a clock source, the clock source will be started or kept running. As soon as the clock source is no longer needed and no peripherals have an active request, the clock source will be stopped until it is requested again.
The clock request can reach the clock source only if the peripheral, the generic clock peripheral channel, and the Generic Clock Generator and its clock are enabled. The time taken from when a clock request is asserted to when the clock source being ready is dependent on the clock source start-up time, clock source frequency, and the divider used in the Generic Clock Generator.
The clock source routing sequence is shown in the figure below:
The total start-up time, TSTART , from when a clock request is made to when the clock is available for the peripheral, is between:
TSTART_MIN = TSOURCE_STARTUP + TSOURCE_PERIOD + TSOURCE_PERIOD_DIVIDED
TSTART_MAX = TSOURCE_STARTUP + (2 × TSOURCE_PERIOD) + (2 × TSOURCE_PERIOD_DIVIDED)
Where:
- TSOURCE_STARTUP is the clock source start-up time
- TSOURCE_PERIOD is the clock source period
- TSOURCE_PERIOD_DIVIDED is the divided clock source period
The time between when the last active clock request stops and when the clock is shut down TSTOP is between:
TSTOP_MIN = TSOURCE_PERIOD_DIVIDED + TSOURCE_PERIOD
TSTOP_MAX = (2 × TSOURCE_PERIOD_DIVIDED) + (2 × TSOURCE_PERIOD)
The On-Demand feature can be disabled individually for each clock source by writing a ‘0’ to the On-Demand bit (ONDEMAND) in each clock source controller register. This will force the clock to always run, even if there are no active clock requests. While this eliminates the clock source start-up time, it will increase the total power consumption of the device.
