Is this a correct debounce?

Resistors, some of the 10ks are out of frame they go to 5v, the 330ohms going to ground are just for safety (case of an accidental digital write) I followed this http://www.ikalogic.com/de-bouncing-circuits/ Just not sure if I did this too fast and messed up and I'm curious about the extent of its effectiveness because other methods were suggested

Fig. 2c is the important part: a shmitt trigger will keep its outputs unchanged during the passage through the ‘unknown’ zone.

I looked at the article a second time, I think may understand better. The 'unknown' zone is still going to give a opportunity for a false reading. (or am I wrong and this is absolute?) I guess what I'm not clear about is if this is more effective then without the caps and how much so. This way I can gauge whether I need the schmitt trigger to start developing without a software debounce

[quote author=Paul Beaudet link=topic=141127.msg1060213#msg1060213 date=1357501456] I looked at the article a second time, I think may understand better. The 'unknown' zone is still going to give a opportunity for a false reading. (or am I wrong and this is absolute?) I guess what I'm not clear about is if this is more effective then without the caps and how much so. This way I can gauge whether I need the schmitt trigger to start developing without a software debounce [/quote]

Since the capacitor is charged through the pull-up resistor when the switch opens, the charge takes a while. Without the Schmidt Trigger the time spent in that transitional area is still subject to random noise causing false readings.

I'd go with software de-bounce, like everyone else. :)

I like the idea of a software debounce, however my attitude changed a bit when I saw some example code debouncing multiple buttons for one its complex and its going to take some more time for me to understand it the other thing is that I'm concerned that soft debouncing make take too much processing time away from my project though this concern isn't establish in any fact, i'm looking to hardware debouncing as a precautionary measure

I'm making a keyer that learns a layout from user fed "chords' and references that chord assignment once it has learnt. I drafted the basic functionality with python and I'm trying to port it over but I think my issues there are probably better a topic for a different thread

FYI http://www.youtube.com/watch?v=CRJUdf5TTQQ&feature=player_embedded

I had already watched that video a while back, but I guess I missed the point the first time, cause I understand a lot more now (seems to be the recurring theme here.. sorry.. haha) This lead to me determining that hardware interrupts are probably going to be needed for my project and the hard debounce is necessary for that to be possible. after researching interrupts for a bit it lead into a couple more relevant questions

An interrupt would be able to detect without bounce, the falling and rising edge of the set-up shown in the op but not constant high or low, right?

Can interrupts work in harmony with one an other? In my situation, i1 = 'a'(input/buttonpres1), i2 = 'b'... then can i1 and i2 = 'c' or will the interrupts... interrupt each other?

further, the most interrupts I can use is 4 on the Arduino Micro, however two are on pins 0 and 1 which are rx and tx. Will this effect the ability to emulate a keyboard?

ok.. well maybe I should start another thread for the second two but in my mind the answers to those questions are completely relevant to "is this the type of debounce im looking for?"

The below look like a good way to handle debounce on multiple buttons is an efficient manner. They show two ways of using the function, either by calling the function every time through the main loop, or having a 20 millisec timer interrupt run the function.

http://www.adafruit.com/blog/2009/10/20/example-code-for-multi-button-checker-with-debouncing/

Lefty

I cannot quite see your circuit but the right one involving two resistors goes like this:

Vcc - 10k resistor - button - GND | 300ohm | |---cap - GND | mcu input pin

dhenry: I cannot quite see your circuit but the right one involving two resistors goes like this:

Vcc - 10k resistor - button - GND | 300ohm | |---cap - GND | mcu input pin

Thank You, I looked the circuit this mourning with fresh eyes and I knew definitely there was something fishy about it. What I have pictured would only show the mcu 10k or null, I believe. Might work but defeats its complexity. I also failed to mention that yellow was to mcu... looking back, the picture is confusing but not wiring it right, description or drawing wouldn't have been any better from me, lol

dhenry: I cannot quite see your circuit but the right one involving two resistors goes like this:

Vcc - 10k resistor - button - GND | 300ohm | |---cap - GND | mcu input pin

| |---cap-- GND | mcu input

Doesn't this defeat the purpose of the second resistor to protect from an accidental digital write?

also what is the best way to test if I got this right with my meter? one probe where the input line is, apply votage.. where should I put the other probe (prob obvious... just not me right now)

Doesn't this defeat the purpose of the second resistor to protect from an accidental digital write?

Not quite. The 2nd resistor controls the discharge of the capacitor. Without the 2nd resistor, the discharge of that capacitor can cause some mcus to reset - think about the parasitic inductance on the pcb traces.

The 2nd resistor provides a limiting factor on that discharge.

You can omit the 2nd resistor if you use a button with large "on" resistance - the smt buttons with rubber conductors for example. With metal contact, you want to have a small resistor there - its value not too critical.