wtr
Full Member level 5
All,
I'm trying to understand the difference between a deglitch and debounce circuit. I saw something here, but I've never seen a debounce that doesn't reset count on a change...seems like what sh1 was implying is a debounce is a moving average.
Maybe someone here can help me with the semantics of debounce vs deglitch because as far as I can identify they are both used to confirm stability for a duration.
I'd probably implement them as described below.
Appreciate anyones input.
Regards,
Okay so the implementation I wrote there will cause deglitch to freak out on a small bounce down. It's more a suppression of a state than an resilience to change.
Fix to deglitch method so that it behaves like debounce!!
I'm trying to understand the difference between a deglitch and debounce circuit. I saw something here, but I've never seen a debounce that doesn't reset count on a change...seems like what sh1 was implying is a debounce is a moving average.
Maybe someone here can help me with the semantics of debounce vs deglitch because as far as I can identify they are both used to confirm stability for a duration.
I'd probably implement them as described below.
- For a deglitch I'd use a shift register and bitwise reduction-AND the sr to confirm stability is true for shift register length. (short and spurious)
- For a debounce I'd probably implement a count, reseting each time there is a change. Once stability is true for count length I confirm change. (Long and like PWM)
Appreciate anyones input.
Regards,
--- Updated ---
Okay so the implementation I wrote there will cause deglitch to freak out on a small bounce down. It's more a suppression of a state than an resilience to change.
--- Updated ---
Fix to deglitch method so that it behaves like debounce!!
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 sig_1 <= sig_1(0) & (AND (sr)); sig_0 <= sig_0(0) & (NOR(sr)); sig_1_re := sig_1(1) ='0' AND sig_1(0)='1'; sig_0_re := sig_0(1) ='0' AND sig_0(0)='1'; if sig_1_re then sig_out <= '1'; elsif sig_0_re then sig_out <= '0'; end if;
Last edited: