It sound very noisy button. I have not seen 30 ms bouncing signal coming from a button. I assume you did not see it under a osciloscope. My avagare bouncing lasts for less than one ms. I use three successive stable readings to validate a keystroke within 12ms periodic polling to read matrix key strokes and it works just fine. Aydin > I am planning to debounce a simple pushbutton connected to a PIC input with > weak pullups enabled. My strategy is to read the button every 10ms, and > when 4 successive reads are the same, consider the level valid. This will > of course mean that the button level must be the same for at least 30ms to > be considered valid. The algorithm I am using will easily allow checking > for up to 8 matching reads, any more than that and I'll have to change the > method. > > Any comments on this? Is 10ms about right? How about using 4 successive > reads, is this enough, too many, etc.? > > > TIA - Martin R. Green > elimar@bigfoot.com >