Reading and Loading the Counters 6-7
PCI-AOB8/12 (16/12) User’s Guide
82
45 Co
unte
r/
Tim
er
ä
ä
ä
ä
Reading and Loading the Counters
If you attempt to read the counters on the fly when there is a high input frequency, you will most
likely get erroneous data. This is partly caused by carries rippling through the counter during
the read operation. Also, the low and high bytes are read sequentially rather than
simultaneously and, thus, it is possible that carries will be propagated from the low to the high
byte during the read cycle.
To circumvent these problems, you can perform a counter-latch operation in advance of the read
cycle. To do this, load the RW1 and RW2 bits with zeroes. This instantly latches the count of the
selected counter (selected via the SC1 and SC0 bits) in a 16-bit hold register. (An alternative
method of latching counter(s) that has an additional advantage of operating simultaneously on
several counters is through a readback command to be discussed later.) A subsequent read
operation on the selected counter returns the held value. Latching is the best way to read a
counter on the fly without disturbing the counting process. You can only rely on directly read
counter data if the counting process is suspended by bringing the gate low.
For each counter you must specify in advance the type of read or write operation that you intend
to perform. You have a choice of loading/reading (a) the high byte of the count, (b) the low byte
of the count, or (c) the low byte followed by the high byte. This last is most generally used and is
selected for each counter by setting the RW1 and RW0 bits to ones. Subsequent read/load
operations must be performed in pairs in this sequence or the sequencing flip-flop in the 8254
chip will get out of step.
The readback command byte format is:
CNT:
When 0, latches the counters selected by bits C0-C2.
STA:
When 0, returns the status byte of counters selected by C0-C2.
C0, C1, C2: When high, select a particular counter for readback. C0 selects Counter 0, C1
selects Counter 1, and C2 selects Counter 2.
B7
B6
B5
B4
B3
B2
B1
B0
1
1
CNT
STA
C2
C1
C0
0
Содержание PCI-AOB16/12
Страница 1: ...www kontron com PCI AOB8 12 16 12 User s Guide Manual PN 00650 151 2A May 2002...
Страница 6: ...vi PCI AOB8 12 16 12 User s Guide This page intentionally left blank...
Страница 8: ...viii PCI AOB8 12 16 12 User s Guide This page intentionally left blank...
Страница 10: ...x PCI AOB8 12 16 12 User s Guide This page intentionally left blank...
Страница 14: ...xiv PCI AOB8 12 16 12 User s Guide This page intentionally left blank...
Страница 16: ...xvi PCI AOB8 12 16 12 User s Guide This page intentionally left blank...
Страница 22: ...xxii PCI AOB8 12 16 12 User s Guide This page intentionally left blank...
Страница 42: ...Chapter 3 Option Selection Contents Introduction 3 3 Output Ranges 3 3 Analog Output Update 3 4...
Страница 46: ...Chapter 4 Address Selection...
Страница 66: ...Chapter 7 Software...
Страница 68: ...Chapter 8 Calibration...