Download 660x Register-Level Programmer Manual

Transcript
Chapter 2
General-Purpose Counter/Timers
Selected Gate
Selected Source
0
Counter Value
2
1
3
1
2
3
3
HW Save Register
1
3
Figure 2-8. Buffered Period Measurement
Buffered Pulse-Width Measurement
Buffered pulse-width measurement is similar to single pulse-width
measurement, but buffered pulse-width measurement takes measurements
over multiple pulses. The counter uses the Selected Source to measure the
pulse width of the signal present on the Selected Gate input, counting the
number of rising edges that occur on the Selected Source while the Selected
Gate remains in an active state. At the completion of each pulse-width
interval for the Selected Gate, the HW Save or SW 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 2-9 shows two pulse widths of a buffered pulse-width
measurement in which the first pulse width is three Selected Source rising
edges and the second pulse width is two Selected Source rising edges. The
counter configuration is as follows:
•
Source: internal
•
Gate: external signal
•
Gate mode: level
•
Gate polarity: inverted
•
Second gate: selected gate
•
Second gate mode: on
•
Second gate polarity: inverted
•
Read from: determined by Gi DMA Status register
•
Interrupt on: DMA interrupt
•
Count once: false
660x Register-Level Programmer Manual
2-10
ni.com