beautypg.com

Figure 8 – Measurement Computing USB-CTR04 User Manual

Page 14

background image

USB-CTR04 User's Guide

Functional Details

Figure 8. 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 9.

Figure 9. 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 10.

14

This manual is related to the following products: