Chapter 8
Counters
©
National Instruments Corporation
8-5
Fig
u
re 8-5 shows an example of a single p
u
lse-width meas
u
rement.
Figure 8-5.
Single Pulse-Width Measurement
Buffered Pulse-Width Measurement
B
u
ffered p
u
lse-width meas
u
rement is similar to single p
u
lse-width
meas
u
rement, b
u
t b
u
ffered p
u
lse-width meas
u
rement takes meas
u
rements
over m
u
ltiple p
u
lses.
The co
u
nter co
u
nts the n
u
mber of edges on the So
u
rce inp
u
t while the Gate
inp
u
t remains active. On each trailing edge of the Gate signal, the co
u
nter
stores the co
u
nt in a hardware save register. A USB Signal Stream transfers
the stored val
u
es to host memory.
Fig
u
re 8-6 shows an example of a b
u
ffered p
u
lse-width meas
u
rement.
Figure 8-6.
Buffered Pulse-Width Measurement
Note that if yo
u
are
u
sing an external signal as the So
u
rce, at least one
So
u
rce p
u
lse sho
u
ld occ
u
r between each active edge of the Gate signal.
This condition ens
u
res that correct val
u
es are ret
u
rned by the co
u
nter. If this
S
OURCE
GATE
Co
u
nter V
a
l
u
e
HW
Sa
ve Regi
s
ter
1
0
2
2
S
OURCE
GATE
Co
u
nter V
a
l
u
e
B
u
ffer
1
0
3
3
2
2
1
2
3
3
2