Konica Minolta PCI-1712 Computer Hardware User Manual


 
– 46 –
Chapter 5
PCI-1712/1712L User’s Manual
Advantech Co., Ltd.
www.advantech.com
Counter/timer operation modes
We enhance the gate function for more applications. For example,
event counting, rate generation, one shot, frequency measurement and
pulse width measurement. We make some innovative arrangements of
clock and gate of counter. For detailed information, please refer to
Appendix D.12 to D.14 and Intel
®
82C54 User’s Manual. The following
sections show how to implement counter functions.
q Event counting
The event counting function helps user count events from the
counter’s associated clock input source.
Each counter features 16-bit, and therefore you can count a maximum
of 65,535 events before the counter overflows and returns to 0. If you
need wider range for event counting, you can use a cascaded 32-bit
counter for counting up to 4,294,967,296 events.
Please follow the procedure below when using software:
1. Select a counter ( e.g. counter 0) to do event counting.
2. Set the counter in mode 0 (Please refer to Intel
®
82C54 User’s
Manual).
3. Connect the pin CNT0_CLK of the counter to the event signal
source.
4. Set the gate type of the counter to positive (logic-high).
5. Reset the counter to 65,535.
6. Pull high the gate input, and then start down counting.
7. After event counting is finished, read the value from the counter.
8. Calculate the number of events.
For example, if the reset value of counter is 65,535 and the read back
value is 43930, then the number of events is 65535 minus 43930 and
thus equals 21605.
q Rate generation
The rate generation function helps user generate a continuous pulse
output signal from the counter. User can use it as an external clock to
output signal to pace other operations, such as analog input, analog
output, or other counter/timer operations.
The frequency of input clock and the number of the counter determine
the period of the output pulse. If you are using one counter (not
cascaded), you can output pulses with a maximum frequency of 5MHz.
In rate generation mode, either the internal or external clock source is