Manual PCI-DA12-8/16
23
B7
B6 B5
B4
B3
B2
B1
B0
OUT NC RW1 RW2 M2 M1
M0 BCD
OUT:
Current state of counter output pin.
NC:
Null count. This indicates when the last count loaded into the counter register has
been loaded into the actual counter. The exact time of load depends on the
configuration selected. Until the count is loaded into the counter, it cannot be
read.
RW1, RW0:
Read/Write command.
M2, M1, M0:
Counter mode.
BCD:
BCD = 0 is binary mode, otherwise counter is in BCD mode.
If both STA and CNT bits in the readback command byte are set low and the RW1 and RW0 bits have
both been previously set high in the counter control register (thus selecting two-byte reads), then reading
a selected counter address location will yield:
1st Read:
Status byte
2nd Read:
Low byte of latched data
3rd Read:
High byte of latched data
After any latching operation on a counter, the contents of its hold register must be read before any
subsequent latches of that counter will have any effect. If a status latch command is issued before the
hold register is read, then the first read will read the status, not the latched value.
8254 Driver
A simple driver is provided to perform basic counter/timer operations on the cards. Source code for the
driver and a sample program showing how to use the functions is in the DOS\CSAMPLES directory. The
following functions are provided:
Frequency Measure
The Frequency Measure function of the 8254 Counter Driver has the ability to measure an unknown
frequency from 1KHz to 2MHz. This function requires as input the Base Address of the card. The
unknown frequency is applied to the CLOCK IN pin of the card. The function will return the frequency as a
long integer in Hz.
long frequency_measure(unsigned BaseAddress);