
Chapter 9 | Counters |
Example Application That Works Correctly
(No Duplicate Counting)
Figure
Source.
|
|
|
|
| Rising Edge |
|
|
|
|
| of Gate |
|
|
|
|
| Counter detects rising edge |
|
|
|
|
| of Gate on the next rising |
|
|
|
|
| edge of Source. |
Gate |
|
|
|
|
|
Source |
|
|
|
|
|
Counter Value | 6 | 7 | 1 | 2 | 1 |
Buffer |
|
| 7 |
| 2 |
|
|
|
|
| 7 |
Figure
On the first rising edge of Gate, the current count of 7 is stored. On the next rising edge of Gate, the counter stores a 2 since two Source pulses occurred after the previous rising edge of Gate.
The counter synchronizes or samples the Gate signal with the Source signal, so the counter does not detect a rising edge in Gate until the next Source pulse. In this example, the counter stores the values in the buffer on the first rising Source edge after the rising edge of Gate. The details of when exactly the counter synchronizes the Gate signal vary depending on the synchronization mode.
ni.com |