Figure 3-5. Event-Counting Applications With External Switch Gating - National Instruments Corporation DAQCard-500 User Manual

Multifunction i/o card for type ii pcmcia bus
Table of Contents

Advertisement

Signal Connections
The MSM82C54 counter/timer is described briefly in Chapter 4, Theory of Operation. For more
detailed programming information, consult the MSM82C54 Data Sheet in the optional
DAQCard-500 Register-Level Programmer Manual.
To perform pulse and square wave generation, program a counter to generate a timing signal at
its OUT output pin.
To count events, program a counter to count rising or falling edges applied to any of the
MSM82C54 CLK inputs. You can then read the counter value to determine the number of edges
that have occurred. You can gate counter operation on and off during event counting. Figure
3-5 shows connections for a typical event-counting operation in which a switch is used to gate
counter 2 on and off.
I/O Connector
Figure 3-5. Event-Counting Application with External Switch Gating
Use level gating to measure pulse width. Apply the pulse to be measured to the GATE2 input.
Load the counter with the known count and program the counter to count down while the signal
at the GATE2 input is high. The pulse width equals the counter difference (loaded value minus
read value) multiplied by the CLK2 period.
To measure time lapse, program counter 2 to be edge gated. Apply an edge to the GATE2 input
to start the counter. Program counter 2 to start counting after receiving a low-to-high edge. The
time lapse since receiving the edge equals the counter value difference (loaded value minus the
read value) multiplied by the CLK2 period.
DAQCard-500 User Manual
25
24
Switch
26
20
27
+5 V
100 kΩ
CLK
GA TE
Counter 2
1 MHz
DGND
DAQCard-500
3-8
© National Instruments Corporation
Chapter 3
OUT

Advertisement

Table of Contents
loading

Table of Contents