Someone posted this a while back, and I found it exceptionally useful. The author concludes that there is only one hard-ware mechanism for a reliable debounce, and that there are few good software versions. Additionally, there is no such thing as a bounce-free switch. An RC mechanism is not reliable. I have recently implemented a mechanism for 4 buttons based on his recommendations, and it has been very reliable. http://ganssle.com/debouncing.pdf Rolf Robertino Benis wrote: > Hi > > >>> What is most probably causing your problem is contact noise >>> > > You were right. > > Putting 0.1uF capacitor in parallel with 100K resistor and connecting them > to the INT0 and the ground helped filtered that bounce out, as u suggested. > > Also thank you for the pointers to the datasheet form Microchip. > > I haven't put any counter(s) into the ISR routine, because I would first > need to add an LCD or something to see/read the value :) > > Interrupt is now processed (almost) every time correctly. Unless I somehow > push that switch button "awkwardly" then it may get triggered twice (or at > least it looks like it was twice). > > There must be some better push switch than that (this is the current guy: > http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&sto > reId=10001&catalogId=10001&productId=106112 , JAMECO part #106112). > > I'll look for something more robust and hopefully less noisy. > > Thanks, > Robertino > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist