Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Switch Debounce for Interrupt Line

Status
Not open for further replies.

tiwari.sachin

Full Member level 6
Joined
Aug 1, 2009
Messages
341
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
India
Activity points
4,449
I am using a switch (when pressed I get a zero), otherwise its high. Quite simple and straight forward

I am connecting the output to the MCU interrupt line

The debounce on the switch can confuse the flipflops that are used on interrupt block and hence I want to have a clean signal there

R-C followed by a schmitt is what I am thinking about.

But then, do I have a better option?



In the above SCH, 3V3 is turned on by a transistor (Need this for some other purpose too, hence using)

When switch is pressed, RC will add the time delay to provide the variation from 1 to 0. Depending on time required, I need to change values of R142 and C157)

Followed by a schmitt which will give a 0 or a 1 and not other value.

Is this right?

I have tried without RC and sch and sometime interrupt works and sometimes doesnt and I think debounce is causing MCU to behave abruptly.
 

Hi,

I've seen the RC debounce done another way, the uploaded jpg, and from experience using it over and again, it works, you obviously would need to orient diode and pull-up/down resistor polarities to suit your application, and I know you know that, but still.

I've never used a Schmitt trigger version, I tried the NAND gate one and must have made a mistake as it seemed terribly bouncy and ringy, I've done the same with a one-shot 555, and concluded the 555 was superfluous to the functioning of the debounce circuit, only the diode, R + C actually seem necessary, so with the Schmitt trigger it's more your own criteria and observations that can know that, sorry I can't help with that aspect.

Small point, the pushbutton model can matter a lot, some are more bell than button if you look with an oscilloscope, but that should be irrelevant with a debounce circuit with suitable value components.

Quick question, please: Do you intend/require the debounce to last only 10uS? - I found that similar timescales sent a CD4017 "over the edge", and - I can't remember how much time, sorry, looks like approx. 10mS - appeared to be not too hot, not too cold, and all that..., but I don't use PICs, just analog stuff.

...But to get to the point, yes, a debounce should be mandatory for all IC inputs with buttons, as the IC will understand hundreds, if not thousands, of presses from both the contact and from the release ringing of the button.
 

Attachments

  • debounce.JPG
    debounce.JPG
    15.3 KB · Views: 32

I see that push button interrupt processing can be meaningful if the processor needs wake up from power saving state. For processors in regular operation it's useless and should be replaced by polling the button in a timer interrupt which also solves all debounce problems.

Most processors don't need hardware debouncing at all, even strange interrupt action on input spikes can be possibly handled in software.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top