Programmable clocks are used in computers as timers for performing a task after a particular duration of time. The frequency of the interrupt is controlled by using a software. A programmable clock has three components:
Crystal oscillator: Crystal oscillator consists of a quartz crystal suspended by a tension. It is used for generating a signal.
Counter: It is used for decrementing counts for signals.
Holding register: It is used for loading a counter.
Single shot operation: In this operation, after a clock is started value of holding register is copied to counter and the counter is decremented for each pulse from the crystal oscillator. When counter is 0, a CPU interrupt occurs.
Square wave operation: In this operation, after an interrupt has occurred, holding register is copied to counter. This process is repeated again and again.
Clock driver: Clock driver is the software component in the clock. It has the following functions:
1) To maintain the time of day.
2) Manage CPU usage.
3) To control the running time of a process.
4) Managing the alarm system call for a user process.
5) Provides a timer for system, does profiling, monitoring, and collects statistics.