![Acces I/O products PCI-A12-16A Скачать руководство пользователя страница 25](http://html.mh-extra.com/html/acces-i-o-products/pci-a12-16a/pci-a12-16a_user-manual_455219025.webp)
Manual PCI-A12-16A
24
Chapter 6: Programmable Interval Timer
The card contains a type 8254 programmable counter/timer which allows you to implement such functions as
a Real-Time Clock, Event Counter, Digital One-Shot, Programmable Rate Generator, Square-Wave
Generator, Binary Rate Multiplier, Complex Wave Generator, and/or a Motor Controller. The 8254 is a flexible
but powerful device that consists of three independent, 16-bit, presettable, down counters. Each counter can
be programmed to any count between 1 or 2 and 65,535 in binary format, depending on the mode chosen.
On the card these three counters are designated Counter #0, Counter #1, and Counter #2. Counter #0 is un-
dedicated, with the gate, output and clock connections fully accessible via the I/O connector. Counter #0 is
enabled by a discrete input and uses either the internal 1MHz clock or an external clock of up to 10MHz.
Counters #1 and #2 are cascaded together to form a 32-bit counter. This dual counter can be enabled (gated)
by program control and is clocked by a 1MHz precision crystal-controlled internal source.
Please note:
The information in this Appendix is for general reference, and may include features or
functions not applicable to this card.
Operational Modes
The 8254 modes of operation are described in the following paragraphs to familiarize you with the versatility
and power of this device. For those interested in more detailed information, a full description of the 8254
programmable interval timer can be found in the Intel (or equivalent manufacturers) data sheets. The
following conventions apply for use in describing operation of the 8254 :
Clock:
A positive pulse into the counter's clock input.
Trigger:
A rising edge input to the counter's gate input.
Counter Loading:
Programming of a binary count into the counter.
Mode 0: Pulse on Terminal Count
After the counter is loaded, the output is set low and will remain low until the counter decrements to zero. The
output then goes high and remains high until a new count is loaded into the counter. A trigger enables the
counter to start decrementing. This mode is commonly used for event counting with Counter #0.
Mode 1: Retriggerable One-shot
The output goes low on the clock pulse following a trigger to begin the one-shot pulse and goes high when
the counter reaches zero. Additional triggers result in reloading the count and starting the cycle over. If a
trigger occurs before the counter decrements to zero, a new count is loaded. Thus, this forms a re-triggerable
one-shot. In mode 1, a low output pulse is provided with a period equal to the counter count-down time.
Mode 2: Rate Generator
This mode provides a divide-by-N capability where N is the count loaded into the counter. When triggered, the
counter output goes low for one clock period after N counts, reloads the initial count, and the cycle starts over.
This mode is periodic, the same sequence is repeated indefinitely until the gate input is brought low. This
mode is used on the card in Counters #1 and #2 to generate periodic A/D start commands. This mode also
works well as an alternative to mode 0 for event counting.
Mode 3: Square Wave Generator
This mode operates periodically like mode 2. The output is high for half of the count and low for the other half.
If the count is even, then the output is a symmetrical square wave. If the count is odd, then the output is high
for (N+1)/2 counts and low for (N-1)/2 counts. Periodic triggering or frequency synthesis are two possible
applications for this mode. Note that in this mode, to achieve the square wave, the counter decrements by two
for the total loaded count, then reloads and decrements by two for the second part of the wave form.