Programmable interval timer (often abbreviated PIT) is a general term for a hardware counter/timer device whose counting behaviour can be configured in software. In computing practice, the term is most closely associated with the Intel 8253 and its successors (notably the Intel 8254), which are the devices conventionally described by the label. The English Wikipedia article titled "Programmable Interval Timer" redirects to the article on the Intel 8253, reflecting this conventional usage.
Overview
A programmable interval timer is a peripheral or integrated circuit that performs timing and counting functions using one or more hardware counters. Each counter decrements in response to an input clock signal and produces an output signal, such as an interrupt request or a square wave, when a programmed terminal condition is reached. Because the counting mode and the initial count value are loaded by the processor at run time, the same physical device can generate a wide range of intervals rather than a single fixed delay.
The Intel 8253 and 8254 are described in manufacturer documentation as programmable interval timers performing timing and counting functions with three independent 16-bit counters. The devices are organised as an array of I/O ports from the system software's point of view.
Architecture
In the Intel 825x family the timer contains three counters, numbered 0 through 2. Each counter has two input pins — CLK (clock input) and GATE — and one output pin, OUT. The three counters are independent 16-bit down counters that can be read by the CPU.
Supporting logic includes:
- A data bus buffer with eight input pins (D7–D0) that buffers transfers between the microprocessor and the internal registers.
- Read/write logic comprising chip select (CS), read (RD), write (WR) and address lines (A0, A1), which select the counter or control register being accessed.
- A control word register holding the programmed configuration that defines how each channel operates.
To initialise a counter, the microprocessor writes an 8-bit control word selecting the target counter, the read/write format (one or two bytes, low byte first or high byte first), the operating mode, and whether the counter counts in binary or in binary-coded decimal. The count value is then written to the counter's data port.
Operating modes
The mode field of the control word selects one of six documented operating modes:
| Mode | Bits (M2 M1 M0) | Function |
|---|---|---|
| 0 | 000 | Interrupt on terminal count |
| 1 | 001 | Hardware-retriggerable one-shot |
| 2 | X10 | Rate generator (divide-by-n) |
| 3 | X11 | Square-wave generator |
| 4 | 100 | Software-triggered strobe |
| 5 | 101 | Hardware-triggered strobe (retriggerable) |
Mode 0 is used to generate a precise software-controlled delay; the OUT pin goes high when the count reaches zero. Mode 2 is a divide-by-n counter commonly used to generate a real-time clock interrupt, and Mode 3 produces a square wave whose duty cycle depends on the parity of the loaded count. All modes respond to the GATE input, though the effect of GATE being low differs by mode: counting is suspended in modes 0 and 4, a rising edge starts counting in modes 1 and 5, and GATE low forces the output high and resets the counter in modes 2 and 3.
History and variants
The 8253 is described in the Intel Component Data Catalog of 1980. The 8254, described as a superset of the 8253 with higher clock-speed ratings, has a preliminary data sheet in the 1982 catalogue. The 8254 is implemented in HMOS and adds a Read Back command absent from the 8253, and permits reading and writing of the same counter to be interleaved. The 825x family was primarily designed for the Intel 8080/8085 processors and was later used in x86-compatible systems. The CMOS 82C53 was outsourced to Oki Electronic Industry; the Intel 82C54 variant handles clock signals up to 10 MHz, and a military version, the M8253, was specified for a temperature range of −55 °C to +125 °C.
Use in IBM PC compatibles and modern systems
The 8253 was used in IBM PC compatibles from their introduction in 1981, and the 825x or an equivalent embedded circuit is found in all IBM PC compatibles and in some Soviet computers such as the Vector-06C. In the original IBM PC design:
- Counter 0 generates the timekeeping interrupt and is assigned to IRQ-0, the highest-priority hardware interrupt.
- Counter 1 triggers DRAM refresh (in early models before the 80386).
- Counter 2 drives the PC speaker.
PC compatibles operate the timer at a clock rate of 105/88 MHz = 1.19318 MHz, one third of the NTSC colour burst frequency, derived by dividing the 14.31818 MHz system clock by 12. Dividing this frequency by 2^16 — the largest divisor the 8253 supports — produces the approximately 18.2 Hz timer interrupt used in MS-DOS and related operating systems.
In modern x86 systems the PIT is generally not a separate chip; its functionality is typically implemented within the motherboard chipset's southbridge, which may result in noticeably faster access to the timer's registers in the I/O address space. Newer platforms provide additional timing facilities, including the High Precision Event Timer (HPET), counters described by the Advanced Configuration and Power Interface (ACPI), a timer in the Local Advanced Programmable Interrupt Controller, and the processor's Time Stamp Counter. Full 8254 compatibility is nevertheless retained for backward compatibility and interoperability, with the Read Back command noted as an important I/O feature for interoperability with multicore CPUs and GPUs.
Broader usage of the term
Beyond the Intel 825x family, "programmable interval timer" is used generically for any timer/counter peripheral whose interval is set by software. Comparable devices include the Renesas (formerly Intersil) 82C54 CMOS programmable interval timer, which provides three independently programmable 16-bit counters with clock input frequencies up to 8, 10 or 12 MHz depending on the variant, and microcontroller timer/counter modules such as the Intel 8253-derived peripheral described in the Intel 8254 datasheet as a general-purpose, multi-timing element. In such usage the term denotes a functional category rather than one specific part number.
Uncertain or unspecified information
This article is based on manufacturer datasheets and the corresponding encyclopedic and technical documentation. Details such as the exact date of first availability of individual variants, the full range of second-source and licensed manufacturers, and the precise behaviour of BCD counting in emulated or chipset-integrated implementations are not consistently documented across sources; where such detail could not be verified, it has been omitted rather than inferred.