
961
HS-82C54RH
The Read-Back Command may be used to latch multiple
Counter Output Latches (OL) by setting the COUNT bit D5 =
0 and selecting the desired Counter(s). This single
command is functionally equivalent 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.
If multiple count Read-Back Commands are issued to the
same Counter without reading the count, all but the first are
ignored; i.e., the count which will be read is the count at the
time the first Read-Back Command was issued.
The Read-Back Command may also be used to latch status
information of selected Counter(s) by setting STATUS bit D4
= 0. Status must be latched to be read; status of a Counter is
accessed by a read from that Counter.
The Counter status format is shown in Figure 13. Bits D5
through D0 contain the Counter’s programmed Mode exactly
as written in the last Mode Control Word. OUTPUT bit D7
contains the current state of the OUT pin. This allows the
user to monitor the Counter’s output via software, possibly
eliminating some hardware from a system.
NULL COUNT bit D6 indicates when the last count written to
the Counter Register (CR) has been loaded into the
Counting Element (CE). The exact time this happens
depends on the Mode of the Counter and is described in the
Mode Definitions, but until the count is loaded into the
D7
D6
D5
D4
D3
D2
D1
D0
OUT
PUT
NULL
COUNT
RW1
RW0
M2
M1
M0
BCD
D7 1 = Out Pin is 1
0 = Out pin is 0
D6 1 = Null count
0 = Count available for reading
D5-D0 = Counter programmed mode (See Figure 5)
FIGURE 13. STATUS BYTE
Counting Element (CE), it can’t be read from the Counter. If
the count is latched or read before this time, the count value
will not reflect the new count just written. The operation of
Null Count is shown in Figure 14.
If multiple status latch operations of the Counter(s) are
performed without reading the status, all but the first are
ignored; i.e., the status that will be read is the status of the
Counter at the time the first status Read-Back Command
was issued.
Both count and status of the selected Counter(s) may be
latched simultaneously by setting both COUNT and STATUS
bits D5, D4 = 0. This is functionally the same as issuing two
separate Read-Back Commands at once, and the above
discussions apply here also. Specifically, if multiple count
and/or status Read-Back Commands are issued to the same
Counter(s) without any intervening reads, all but the first are
ignored. This is illustrated in Figure 15.
If both count and status of a Counter are latched, the first
read operation of that Counter will return latched status,
regardless of which was latched first. The next one or two
reads (depending on whether the Counter is programmed
for one or two byte counts) return latched count. Subsequent
reads return unlatched count.
THIS ACTION:
CAUSES:
A. Write to the Control Word Register: (Note 1)
Null Count = 1
B. Write to the Count Register (CR): (Note 2)
Null Count = 1
C. New count is loaded into CE (CR
→
CE):
Null Count = 0
NOTES:
1. Only the Counter specified by the Control Word will have its Null
Count set to 1. Null Count bits of other Counters are unaffected.
2. If the Counter is programmed for two-byte counts (least signifi-
cant byte then most significant byte) Null Count goes to 1 when
the second byte is written.
FIGURE 14. NULL COUNT OPERATION
COMMAND
DESCRIPTION
RESULT
D7
D6
D5
D4
D3
D2
D1
D0
1
1
0
0
0
0
1
0
Read back count and status of
Counter 0
Count and status latched for Counter 0
1
1
1
0
0
1
0
0
Read-back status of Counter 1
Status latched for Counter 1
1
1
1
0
1
1
0
0
Read-back status of Counters 2, 1
Status latched for Counter 2, but not
Counter 1
1
1
0
1
1
0
0
0
Read-back count of Counter 2
Count latched for Counter 2
1
1
0
0
0
1
0
0
Read-back count and status of
Counter 1
Count latched for Counter 1, but not
status
1
1
1
0
0
1
0
0
Read-back status of Counter 1
Command ignored, status already
latched for Counter 1
FIGURE 15. READ-BACK COMMAND EXAMPLE
Spec Number
518059