Tandy 1000 HX Technical Reference Manual page 118

Table of Contents

Advertisement

8253/8253-5
8253 READ/WRITE PROCEDURE
Write Operations
The systems software must program each counter
of the 8253 with the mode and quantity desired. The
programmer must write out to the 8253 a MODE
control word and the programmed number of count
register bytes (1 or 2) prior to actually using the se-
lected counter.
The actual order of the programming is quite flexible.
Writing out of the MODE control word can be in any
sequence of counter selection, e.g., counter #0
does not have to be first or counter #2 last. Each
counter's MODE control word register has a sepa-
rate address so that its loading is completely se-
quence independent. (SCO, SC1).
The loading of the Count Register with the actual
count value, however, must be done in exactly the
sequence programmed in the MODE control word
(RLO, RL1). This loading of the counter's count reg-
ister is still sequence independent like the MODE
control word loading, but when a selected count reg-
ister is to be loaded it must be loaded with the num-
ber of bytes programmed in the MODE control word
(RLO, RL1). The one or two bytes to be loaded in the
count register do not have to follow the associated
MODE control word. They can be programmed at
any time following the MODE control word loading
as long as the correct number of bytes is loaded in
order.
All counters are down counters. Thus, the value
loaded into the count register will actually be decre-
mented. Loading all zeros into a count register will
result in the maximum count (2
16
for Binary or 10
4
for BCD). In MODE 0 the new count will not restart
until the load has been completed. It will accept one
of two bytes depending on how the MODE control
words (RLO, RL1) are programmed. Then proceed
with the restart operation.
MODE Control Word
Counter n
LSB
Counter Register byte
Counter n
MSB
Counter Register byte
Counter n
NOTE:
Format shown is a simple example of loading the 8253
and does not imply that it is the only format that can be
used.
Figure 8. Programming Format
NOTE:
The exclusive addresses of each counter's count regis-
ter make the task of programming the 8253 a very sim-
ple matter, and maximum effective use of the device
will result if this feature is fully initilized.
Figure 9. Alternate Programming Formats
2-20
No.1
No. 2
No. 3
No. 4
No. 5
No. 6
No. 7
No. 8
No. 9
MODE Control Word
Counter 0
MODE Control Word
Counter 1
MODE Control Word
Counter 2
.
C D
Count Register Byte
L b B
Counter 1
. .
C Q
Count Register Byte
M S B
Counteri
.
C Q
Count Register Byte
L b B
Counter 2
M Q D
Count Register Byte
M b B
Counter 2
.
C D
Count Register Byte
L b B
Counter 0
Men
Co
un
* Register Byte
M b B
Counter 0
A1
1
1
1
0
0
1
1
0
0
AO
1
1
1
1
1
0
0
0
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents