4.5Timer/Counter Operation
The
CN3 |
|
|
|
|
|
|
|
|
|
|
|
| 8254 Timer/Counter |
|
|
| ||||
|
|
| INT |
|
|
| EXT |
|
|
|
|
| ||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||||||
|
|
|
|
| Counter 0 |
|
|
|
|
| ||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| CLK0 |
|
|
|
|
|
CN3 |
|
|
|
|
|
|
|
|
|
|
|
| GATE0 | OUT0 |
|
|
| CN3 | ||
|
|
| Vcc |
|
|
|
|
|
|
|
| |||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||||
|
|
|
|
|
|
|
|
|
|
|
|
|
| |||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Counter 1 |
|
|
|
|
|
CN3 |
|
|
|
|
|
|
|
|
|
|
|
| CLK1 |
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
| GATE1 | OUT1 |
|
|
| A/D Trigger | |||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||||||
2MHz |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| CN3 | ||
|
|
|
|
|
|
|
|
|
|
|
| Counter 2 |
|
|
|
|
| |||
Oscillator |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| CLK2 | OUT2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| GATE2 |
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Figure 4.5 Block Diagram of 8254 Timer/Counter
The clock source of counter 0 can be internal or external, while the gate can be controlled externally and the output is send to the connector CN3. As to counter 0 and counter 1, the clock source is internally fixed, while the gate can be controlled externally and the output is send to the connector CN3 too. All the timer/ counter signals are TTL compatible.
The following shows how to configure the 8254 timer / counter chip.
The 8254 Timer / Counter Chip
The Intel (NEC) 8254 contains three independent, programmable, multimode 16 bit counter/timers. The three independent 16 bit counters can be clocked at rates from DC to 5 MHz. Each counter can be individually programmed with 6 different operating modes by appropriately formatted control words. The most commonly uses for the 8254 in microprocessor based system are:
Øprogrammable baud rate generator
Operation Theorem ∙ 35