Real Time Devices AD1200 User Manual page 96

Table of Contents

Advertisement

intef
82C54
COUNTER LATCH COMMANO
The second method uses the "Gounter Latch Com-
mand". Like a Control Word, this command is written
to the Control Word Register, which is selected
when 41, Ao : 11. Also like a Control Word, the
SCO, SC1 bits select one of the three Counters, but
two other bits, D5 and D4, distinguish this command
from a ControlWord.
A l , A O : 1 1 ; 6 : 0 ; R D - : 1 ; W F : O
D7
D5
D5
Da
D3
D2
D1
Ds
SC1, SCO - specify counter to be latched
scl
sco
Counter
0
0
1
1
0
1
0
1
0
1
2
Read-Back Command
D5,D4 - 00 designates Counter Latch Command
X - don't care
NOTE:
Don't care bits (X) should be 0 to insure compatibility
with future Intel products.
sc1
sc0
0
0 t x
X
X
X
Figure 9. Counter Latchlng Command Format
The selected Counter's output tatch (OL) latches the
count at the time the Counter Latch Command is
received. This count is held in the latch until it is read
by the CPU (or until the Counter is reprogrammed).
The count is then unlatched automaticaliy and the
OL returns to "following" the counting element (CE).
This allows reading the contents oi the Counters
:'9! the fly" without atfecting counting in progress.
Multiple Gounter Latch Commands miy be used to
latch more than one Counter. Each latched Goun-
ter's OL holds its count until it is read. Counter Latch
Commands do not affect the programmed Mode of
the Counter in any way.
lf a Counter is latched and then, some time later,
latched again before the count is read, the second
Counter Latch Command is ignored. The count read
will be the count at the time the first Counter Latch
Command was issued.
With either method, the count must be read accord-
ing to the programmed format; specifically, if the
Counter is programmed for two byte counts, two
bytes must be read. The two bytes do not have to be
read one right after the other; read or write or pro-
gramming operations of other Counters may be in-
serted between them.
Another feature of the 82C54 is that reads and
writes of the same Counter may be interleaved: for
example, if the Counter is programmed for two byte
counts, the following sequence is valid.
'1.
Read least significant byte.
2. Write new least significant byte.
3. Read most significant byte.
4. Write new most significant byte.
lf a Counter is programmed to readlwrite two-byte
counts, the following precaution applies; A program
must not transfer control between reading the first
and second byte to another routine which also reads
from that same Counter. Otheruvise, an incorrect
count will be read.
READ.BACK COMMAND
The third method uses the Read-Back command.
This command allows the user to check the count
value, programmed Mode, and current state of the
OUT pin and Null Count flag of the selected coun-
ter(s).
The command is written into the Control Word Reg-
ister and has the format shown in Figure 10. The
command applies to the counters selected by set-
ting their corresponding bits DB,D2,D1 : 1.
A 0 , A 1 : 1 1
Q $ - O
F D : 1
W F : o
D5: 0 : Latch count ol selected counter(s)
Da:0 : Latch status of selected counter(s)
D3: 1 : Select counter 2
D2: 1 = Select counter 1
Dr: 1 : Select counter 0
Dg: Reserved for luture expansion; must be 0
D7
Da
D 1
1
1
6TNT
SlTr-US
CNT2
CNT 1 C N T O 0
Figure 10. Read-Back Command Format
The read-back command may be used to latch multi-
S_pgnter
output latches (OL) by setting the
COUNT bit D5:0 and selecting the desired Loun-
te(s). This single command is functionally equiva_
lent to several counter latch commands, one for
each counter latched. Each counter's latched count
is held until it is read (or the counter is repro-
grammed). That counter is automatically unlatched
when read, but other counters remain latched until
they are read. lf multiple count read-back commands
are issued to the same counter without reading the
3-89

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ada1200

Table of Contents