Duplicate count prevention, also known as synchronous counting mode, ensures that a counter returns correct data in applications that use a slow or non-periodic external source. Duplicate count prevention applies only to buffered counter applications such as measuring frequency or period. In such buffered applications, the counter should store the number of times an external source pulses between rising edges on the Gate signal.
With duplicate count prevention enabled, the counter synchronizes both the Source and Gate signals to the maximum (80 MHz) internal timebase. By synchronizing to the timebase, the counter detects edges on the Gate even if the Source does not pulse. This enables the correct current count to be stored in the buffer.
Consider Figure 3 with duplicate counting prevention. Normally, the counter value changes synchronously to the Source signal. With duplicate count prevention, the counter value changes synchronously to the maximum internal timebase. Thus the internal timebase is really the source.
Figure 3. Duplicate Count Prevention.
Furthermore, only the first edge of the counter’s timebase is used to increment the count register once each external source edge is detected even if the Source pulse is long. All the other timebase edges that occur while the external source input is high are ignored. If no source edges are detected between two gate edges, as shown in Figure 3, duplicate count prevention ensures that pulse measurements return zero because the external source must be logic high to allow the internal timebase to increment the count register. This reduces your maximum source frequency to quarter of the original maximum (80MHz) timebase for NI-STC II and NI-TIO boards. Therefore duplicate count prevention should only be used if the frequency of the Source signal is 20 MHz or less.
Duplicate count prevention should only be use in the following situations:
- Counter measurements
- The counter Source is using an external signal (such as PFI x)
- The frequency of the external source is 20 MHz or less