Hi Tim, I would probably insert an assembly routine to deal with that. I would chec= k the bouncing of the switch on the scope and get a minimum debouncing time= and then create a loop which decrements a register until the time is reach= ed, based on CLK used and number of instructions. So on the program every t= ime a switch is pressed you jump to this routine and initiate count, when y= ou exit the routine (time as been reached), check if switch is still presse= d. This is an easy way to do this but has the drawback that while you are doin= g this you can not do anything else. The timer method you can go and do som= ething else and generate an interrupt when time as been reached. Using the = timer is the more elegant solution and you should definitely move in that d= irection, but if you need the timer for something else and you are not worr= ied about performance that much at the moment, then the loop solution will = work. Hope it helps = Best regards Luis = -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of= Tom Sefranek Sent: 03 April 2006 11:28 To: Microcontroller discussion list - Public. Subject: Re: [PIC] debouncing in c Tim Losereith wrote: >Hello, > >I am looking for an example to debounce several push buttons in c. While = >debouncing the micro shouldn=B4t be blocked by a timer. > = > SO use the HARDWARE timer! (I do!) Tom -- = * | __O Thomas C. Sefranek WA1RHP@ARRL.net |_-\<,_ Amateur Radio Operator: WA1RHP = (*)/ (*) Bicycle mobile on 145.41, 448.625 MHz http://hamradio.cmcorp.com/inventory/Inventory.html http://www.harvardrepeater.org -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist