Chapter 8
Counters
8-14
ni.com
80 MHz Timebase. Yo
u
r meas
u
rement may ret
u
rn 1600 ± 1 cycles
depending on the phase of the signal with respect to the timebase. As
yo
u
r freq
u
ency becomes larger, this error of ±1 cycle becomes more
significant; Table 8-1 ill
u
strates this point.
•
Method 1b (meas
u
ring K periods of F1) improves the acc
u
racy of the
meas
u
rement. A disadvantage of Method 1b is that yo
u
have to take
K + 1 meas
u
rements. These meas
u
rements take more time and
cons
u
me some of the available USB bandwidth.
•
Method 2 is acc
u
rate for high freq
u
ency signals. However, the
acc
u
racy decreases as the freq
u
ency of the signal to meas
u
re
decreases. At very low freq
u
encies, Method 2 may be too inacc
u
rate
for yo
u
r application. Another disadvantage of Method 2 is that it
req
u
ires two co
u
nters (if yo
u
cannot provide an external signal of
known width). An advantage of Method 2 is that the meas
u
rement
completes in a known amo
u
nt of time.
•
Method 3 meas
u
res high and low freq
u
ency signals acc
u
rately.
However, it req
u
ires two co
u
nters.
Table 8-1.
Frequency Measurement Method 1
Task
Equation
Example 1
Example 2
Act
u
al Freq
u
ency to Meas
u
re
F1
50 kHz
5 MHz
Timebase Freq
u
ency
Ft
80 MHz
80 MHz
Act
u
al N
u
mber of Timebase
Periods
Ft/F1
1600
16
Worst Case Meas
u
red N
u
mber of
Timebase Periods
(Ft/F1) – 1
1599
15
Meas
u
red Freq
u
ency
Ft F1/(Ft – F1)
50.031 kHz
5.33 MHz
Error
[Ft F1/(Ft – F1)] – F1
31 Hz
333 kHz
Error %
[Ft/(Ft – F1)] – 1
0.06%
6.67%