Chapter 8
Counters
©
National Instruments Corporation
8-13
Figure 8-13.
Method 3
Then ro
u
te the Co
u
nter 0 Internal O
u
tp
u
t signal to the Gate inp
u
t of
Co
u
nter 1. Yo
u
can ro
u
te a signal of known freq
u
ency (F2) to the
Co
u
nter 1 So
u
rce inp
u
t. F2 can be 80MHzTimebase. For signals that
might be slower than 0.02 Hz,
u
se a slower known timebase. Config
u
re
Co
u
nter 1 to perform a single p
u
lse-width meas
u
rement. S
u
ppose the
res
u
lt is that the p
u
lse width is J periods of the F2 clock.
From Co
u
nter 0, the length of the p
u
lse is
N
/F1. From Co
u
nter 1, the
length of the same p
u
lse is J/F2. Therefore, the freq
u
ency of F1 is
given by F1 = F2 * (
N
/J).
Choosing a Method for Measuring Frequency
The best method to meas
u
re freq
u
ency depends on several factors
incl
u
ding the expected freq
u
ency of the signal to meas
u
re, the desired
acc
u
racy, how many co
u
nters are available, and the meas
u
rement d
u
ration.
•
Method 1
u
ses only one co
u
nter. It is a good method for many
applications. However, the acc
u
racy of the meas
u
rement decreases as
the freq
u
ency increases.
Consider a freq
u
ency meas
u
rement on a 50 kHz signal
u
sing an
80 MHz Timebase. This freq
u
ency corresponds to 1600 cycles of the
S
OURCE
OUT
COUNTER 0
S
OURCE
GATE
OUT
COUNTER 1
S
ign
a
l to
Me
asu
re (F1)
S
ign
a
l of Known
Freq
u
ency (F2)
CTR_0_
S
OURCE
(
S
ign
a
l to Me
asu
re)
CTR_0_OUT
(CTR_1_GATE)
CTR_1_
S
OURCE
Interv
a
l
to Me
asu
re
0 1 2
3
…
N