Timer Parameters; Reading The Counters - NCR PC4I Technical Reference

Hide thumbs Also See for PC4I:
Table of Contents

Advertisement

C
C
(
PROGRAMMABLE INTELUGENCE
Tiller Parameters
Following the Timer Control Register byte detailed
above, the Timer expects the number of bytes
specified in the two bits R/W to be transmitted by
the microprocessor (load operation), or the specified
number of bytes to be read. The one or two-byte value
is then read from or written to the data bus. Loading
all zeros into a Counter results in a maximum count
(OFFFFH in binary,
9999 in BCD counting).
Note that it is not necessary to read or write
immediately after setting the Timer Control Register.
However, the specified number of bytes must be read
or written. In mode O,
as soon as the Timer
recognizes that the first (or only) byte is being
transmitted, the decrementing process is suspended
until the new Counter contents have been read.
Reading the Counters
Reading Counter registers requires some care in order
not to disturb the counting process. A Counter can be
read directly or via a Counter Latch. The former
method requires counting to be inhibited during the
reading process. This can be achieved only by
controlling the Gate or suspending the clock signal
to the Counter which is to be read. For this reason,
you should use the Counter Latch method.
To read a Counter Latch, a byte must be written to
the Control Register, specifying the Counter and with
D5 and D4 zero (this command has no effect on the
MODE and BCD settings). Then issue a read Counter
byte to the Control Register and read the one or two
bytes specified.
An example of Timer programming in a real-time
application is included in the section of this
Chapter dealing with the Programmable Interrupt
Controller. The programming example given in the
Chapter describing the loudspeaker also makes of the
Timer.
2-9

Advertisement

Table of Contents
loading

Table of Contents