Chapter 4
General-Purpose Counter/Timer
©
National Instruments Corporation
4-9
DAQ-STC Technical Reference Manual
4.4.2.5 Buffered Pulsewidth Measurement
Buffered pulsewidth measurement is similar to single-pulsewidth measurement, except that
the measurements are taken over multiple pulses. The counter uses G_SOURCE to measure
the pulsewidth of the signal present on the G_GATE input, counting the number of rising
edges that occur on G_SOURCE while G_GATE remains in an active state. At the completion
of each pulsewidth interval for G_GATE, the HW save register latches the counter value for
software read. An interrupt notifies the CPU after each period so that the interrupt software
can read the value in the HW save register. Figure 4-11 shows two pulsewidths of a buffered
pulsewidth measurement where the first pulsewidth is three G_SOURCE rising edges and the
second pulsewidth is two G_SOURCE rising edges.
Figure 4-11.
Buffered Pulsewidth Measurement
4.4.3 Pulse Generation
In the pulse generation functions, the counter generates a single pulse of specified duration
following the software arm. The software arm occurs when software sets the counter arm bit
in the DAQ-STC register map. The following actions are available in pulse generation:
•
The counter uses G_SOURCE as a timebase to generate the pulse.
•
The user specifies the pulse parameters in terms of periods of the G_SOURCE input.
•
G_GATE can serve as a trigger signal to generate a pulse after the first active gate edge,
or after each active gate edge.
•
An alternate output mode is provided so that G_OUT outputs two counter TC pulses,
instead of a single long pulse.
4.4.3.1 Single Pulse Generation
The single pulse generation function generates a single pulse with programmable delay and
programmable pulsewidth following the software arm. The counter uses G_SOURCE as a
timebase to generate the pulse, so you specify the pulse parameters in terms of periods of the
G_SOURCE input. Software implements pulse generation by loading the delay value into the
counter, loading the pulsewidth value into the load register, and programming the counter
G_SOURCE
G_GATE
Counter Value
HW Save Register
1
0
3
3
2
2
1
2