Debounce mode comparisons – Measurement Computing USB-QUAD08 User Manual
Page 24

USB-QUAD08 User's Guide
Functional Details
24
Debounce mode comparisons
Figure 20 shows how the two modes interpret the same input signal, which exhibits glitches. Notice that the
trigger before stable mode recognizes more glitches than the trigger after stable mode. Use the
bypass
option
to achieve maximum glitch recognition.
Figure 20. Example of two debounce modes interpreting the same signal
Set the debounce time according to the amount of instability expected in the input signal. Setting a debounce
time that is too short may result in unwanted glitches clocking the counter. Setting a debounce time that is too
long may result in an input signal being rejected entirely. Some experimentation may be required to find the
appropriate debounce time for a particular application.
To see the effects of different debounce time settings, view the analog waveform along with the counter output.
This can be done by connecting the source to an analog input.
Use trigger before stable mode when the input signal has groups of glitches and each group is to be counted as
one. The trigger before stable mode recognizes and counts the first glitch within a group but rejects the
subsequent glitches within the group if the debounce time is set accordingly. Set the debounce time to
encompass one entire group of glitches, as shown in Figure 21.
Figure 21. Optimal debounce time for "trigger before stable" mode
Trigger after stable mode behaves more like a traditional debounce function: rejecting glitches and only passing
state transitions after a required period of stability. Trigger after stable mode is used with electro-mechanical
devices like encoders and mechanical switches to reject switch bounce and disturbances due to a vibrating
encoder that is not otherwise moving.