Measurement Specialties PCI-2513 Computer Hardware User Manual


 
PCI-2513 User's Guide Functional Details
23
Figure 4-7. Example of two debounce modes interpreting the same signal
Debounce times should be set 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
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, simply 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. The debounce time should be set
to encompass one entire group of glitches as shown in the following diagram.
Figure 4-8.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. The debounce time should be set short enough to accept the desired input
pulse but longer than the period of the undesired disturbance as shown in Figure 4-9.