DM5210 analog input module 4-16 RTD Embedded Technologies, Inc.
Timer/Counters
An 8254 programmable interval timer provides three 16-bit, 8-MHz timer/counters for timing and counting
functions such as frequency measurement, event counting, and interrupts. All three timer/counters are cascaded at the
factory. Figure 4-2 shows the timer/counter circuitry.
5200
I / O CONNE CTOR
P2
EXT CL K 0
PI N 4 6
PI N 4 3
T / C OUT 1
PI N 4 2
8254
TI ME R/
C O U N T E R
0
CL K
GATE
OUT
T I ME R/
C O U N T E R
1
CL K
GATE
OUT
EC0
OSC
TI ME R/
C O U N T E R
2
CL K
GATE
OUT
EXT CL K 1
OSC
OT 1
EC2
PI N 3 9
PI N 4 4
EXT GAT E 2
T / C OUT 2
EXT CL K 2
8 MHz
P 4
OSC
OT 0
EC1
+5 V
+5 V
+5 V
PI N 1 9
PI N 4 0
PI N 4 1
PI N 4 5
EXT GAT E 0
T / C OUT 0
EXT GAT E 1
Fig. 4-2 — 8254 Programmable Interval Timer Circuit Block Diagram
Each timer/counter has two inputs, CLK in and GATE in, and one output, timer/counter OUT. They can be
programmed as binary or BCD down counters by writing the appropriate data to the command word, as described in
the I/O map section at the beginning of this chapter.
One of two clock sources, the on-board 8-MHz crystal or an external clock can be selected as the clock input to
each timer/counter. In addition, the timer/counters can be cascaded by connecting TC0’s output to TC1’s clock input
and TC1’s output to TC2’s clock input. The diagram shows how these clock sources are connected to the timer/
counters.
An external gate source can be connected to each timer/counter through the I/O connector. When a gate is
disconnected, an on-board pull-up resistor automatically pulls the gate high, enabling the timer/counter.
The output from each timer/counter is available at the I/O connector, where it can be used for interrupt genera-
tion or for counting functions.
The timer/counters can be programmed to operate in one of six modes, depending on your application. The
following paragraphs briefly describe each mode.
Mode 0, Event Counter (Interrupt on Terminal Count). This mode is typically used for event counting.
While the timer/counter counts down, the output is low, and when the count is complete, it goes high. The output
stays high until a new Mode 0 control word is written to the timer/counter.
Mode 1, Hardware-Retriggerable One-Shot. The output is initially high and goes low on the clock pulse
following a trigger to begin the one-shot pulse. The output remains low until the count reaches 0, and then goes high
and remains high until the clock pulse after the next trigger.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com