![background image](http://html1.mh-extra.com/html/national-instruments/usb-6210/usb-6210_user-manual_3656406111.webp)
Chapter 8
Counters
8-14
ni.com
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 1,600 cycles of the
80 MHz Timebase. Yo
u
r meas
u
rement may ret
u
rn 1,600 ± 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.
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
1,600
16
Worst Case Meas
u
red N
u
mber of
Timebase Periods
(Ft/F1) – 1
1,599
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%