Patent ID: 8558606
Filing Date: 2013-10-15
Classification: H03K

Abstract:
1. A debounce apparatus, comprising: a debounce module, configured for receiving an input signal and eliminating a bounce phenomenon of the input signal within a transient-time of a state-changing of the input signal so as to produce a debounce signal; a register, configured for outputting an output signal according to a value stored in the register; a timer, coupled to the debounce module and the register, wherein when the input signal changes its state, the timer starts time-counting according to a counting-value of settling-time, and when the debounce signal changes its state, the timer recounts time, and a counting module, coupled to the timer for receiving the input signal, configured for counts a duration for the input signal being changing the state thereof so as to obtain a present counting-value of signal change, wherein when the input signal changes its state, the counting module clears a queue and re-samples the input signal in fixed clocks and pushes a sampled signal into the queue; in a condition that the values obtained by sampling the input signal keep the same, the number of the values stored in the queue is counted so as to obtain the present counting-value of signal change, wherein in a condition that the present counting-value of signal change is greater than a maximal counting-value of signal change, the maximal counting-value of signal change is substituted by the present counting-value of signal change and the counting-value of settling-time is updated, and wherein when the timer ends time-counting and when a value corresponding to the debounce signal is different from the value stored in the register, the value stored in the register is updated by the value corresponding to the debounce signal.