Hi, Well, I am finally moving from hobby to pro zone. I got a simple project where I have to design a triac based ac power controller with two push buttons, one to increase power to triac and one to decrease power. Power level is displayed on a single 7-seg display. Hardware design is based on 16F84 because they are available dirt cheap here. Timing of the circuit it based around zero crossings which at 50 Hz happens at every 10ms. I have an ISR that does the following every zero crossing. - pulse triac gate at set time delay - read and act on button state - display power level on the display These steps can be done easily in 10ms except that doing software based switch debouncing needs longer than 20ms (10ms for switch down, 10ms for switch up). This results in ISR being called while still reading switches and ISR calls switch reading routine again and therefore I have recursion and a quick stack overflow error. How do I do switch debouncing here? Will a reduced debounce time of 8ms work? Is there a better software design? PS: The whole project is in simulation stage and no breadboarding done yet. Small size and low cost are important considerations so I can't do hardware debouncing. Thanks for your help. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist