Thanks Brett, very interesting read, indeed! But too sophisticated to me, the dimensioning and the structure of the circuit is beyond my skills. I was looking for some rule of thumbs, or simple “normally I just put a cap at the bla bla which works 90% of the times…”.
I was also hoping that there was some software based debouncing tricks that might be used.
@ RobvanSchelven - I have been thinking and looking sheets like this [url]http://grathio.com/assets/capacitor_tags.pdf[/url] but there is no help to help me understand what it means when there is only a “.1” on the stamp…the leftmost on the pic…?? :think:
If you need to do this in hardware, have a look at the MAX812 as this will debounce your switch nicely for you and is nice and small. It is designed for micro reset but will work fine for your application. I generates a HIGH pulse when you ground the input.
@ njbuch, RobvanSchelven asked a question that I did not see an answer for. He asked "Did you set you interrupt type to negative edge? "
In all my years detecting switch inputs I have never had to do more than use a 4.7k pullup resistor and 0.1uf cap.
I would also say anything less that 0.1uf would not be of much help debouncing a switch.
There are some tricks that you can use in software to also help with the debounce a IRQ input.
After the first negative edge is detected and you jump to you IRQ routine, the first thing you would do is disable that IRQ. That will prevent any ringing on that switch line from triggering any consequence IRQ’s. Do what you need to do in the IRQ and just before you leave the IRQ clear the IRQ register and turn it back on. This will give it a bit of a software debounce.
If what you are doing in the IRQ is not that long, then dont enable it before you exit the IRQ. But rather whatever event is to happen from that IRQ event being fired when the code jumps there you can then first clear the IRQ, and re-enable it. that will give it even more time to get around any debounce issues.