Its uses are to:
- Interrupt a time-sharing operating system at evenly spaced intervals so
that it can switch programs.
- Output precisely timed signals with programmed periods to an I/O device
(e.g. an A/D converter).
- Serve as a programmable baud rate generator.
- Measure time delays between external events.
- Count the number of times an event occurs in an external experiment
and provide a means of inputting the count to the computer.
- Cause the processor to be interrupted after a programmed number of
external events have occurred.
The mode determines exactly what happens when the count becomes 0 and/or
a signal is applied to the gate input.Some possible actions are:
- The GATE input is used for enabling and disabling the CLK input.
- The GATE input may cause the counter to be reinitialized.
- The GATE input may stop the count and force OUT high.
- The count will give an OUT signal and stop when it reaches 0.
- The count will give an OUT signal and automatically be reinitialized
from the Initial Count Register when the count reaches 0.
The modes could be defined by combinations of these possibilities.
As an example, consider the application of an interval timer to a time-sharing
operating system.In this case a clock would be connected to the CLK input
and OUT to an interrupt request line, possibly to a nonmaskable line.
The GATE input would not be needed.When the system is brought up the initial
count register would be filled with
Initial count = Clock frequency x T
where T is the length of each time slice in seconds, and the mode would be
set so that each time the count reaches 0 the contents of the initial
register would be transferred to the counter and OUT would become active.