
Chapter 9 | Counters |
Example Application That Works Incorrectly
(Duplicate Counting)
In Figure
|
| No Source edge, so no |
|
| value written to buffer. |
Gate |
|
|
Source |
|
|
Counter Value 6 | 7 | 1 |
Buffer |
| 7 |
Figure
Example Application That Prevents Duplicate Count
With duplicate count prevention, the counter synchronizes both the Source and Gate signals to the 80 MHz Timebase. By synchronizing to the timebase, the counter detects edges on Gate even if the Source does not pulse. This enables the correct current count to be stored in the buffer even if no Source edges occur between Gate signals, as shown in Figure
Counter detects | Counter value |
rising Gate edge. | |
| increments only |
Gate | one time for each |
| Source pulse. |
Source |
|
80 MHz Timebase
Counter Value | 6 | 7 | 0 | 1 |
Buffer |
|
| 7 | 0 |
|
|
|
| 7 |
Figure
© National Instruments Corporation |