A SERVICE OF

logo

PCI30FG User Manual
Eagle Technology © Copyright 2002 17
Counters
The counter sub-system is supported by functions to Write, Read and
Configure. There are 4 counters that are available to the user and are
compatible with the industry standard 8254 counter-timer. The table below
shows all counters and their assigned function on the board. Please note that
only some are available for the user. The 8254 datasheet has more
information on the counter-timer modes.
Counter Software Assigned
Number
Description
0 N/A ADC clock
1 N/A ADC prescaler
2 3 User Counter 3
3 0 User Counter 0
4 1 User Counter 1
5 2 User Counter 2
Table 4-1 Counter Assignment
Writing the initial counter value
A single call is necessary to write a counter’s initial load value.
API-CALL
Long EDRE_CTWrite(ulng Sn, ulng Ct, ulng Value)
The serial number, counter-number, and a value must be passed by the
calling function. A return code will indicate if any errors occurred.
ACTIVEX CALL
Long EDRECTX.Write(long Port, ulng Value)
The port number and value to be written needs to be passed and the returned
value holds an error or the value read. If the value is negative an error did
occur.
Reading a counter
A single call is necessary to read a counter’s current value.
API-CALL
Long EDRE_CTRead(ulng Sn, ulng Ct, pulng Value)
The serial number, counter-number, and a pointer must be passed by the
calling function. A return code will indicate if any errors occurred. The value
buffer will hold the value read from the counter.
ACTIVEX CALL
Long EDRECTX.Read(long Port)
The port number needs to be passed. The returned value will either hold the
error code or the value read from the counter. If negative it means an error
occurred, otherwise it is the value read from the counter.