I'm working on a Timer1-based project where a button should serve three purposes: start the timer, stop the timer, reset the timer. Implementing the start/stop alone is easy (TMR1ON = 1 ^ TMR1ON), but I'm having serious problems figuring out how I can implement the reset as well. What I have been playing around with is Timer0. As soon as RA0 is pressed T0IE is set (cleared when RA0 is released), and the ISR counts overflows. Later I have made logic based on the amount of TMR0-overflows. This is how I want it to behave: * (If RA0 is pressed) AND (Timer1 is stopped) AND (overflows > 50) => reset * (If RA0 is pressed) AND (either state of Timer1) AND ( 0 < overflows < 5) => TMR1ON = 1 ^ TMR1ON (50 overflows is a couple of seconds - no need to be exact) I have implemented both of these but I cannot make them work together. Been wasting(?) two hours on this so I can't really think straight any longer. Does anyone have suggestions for another approach other than use Timer0? -- - Rikard - http://bos.hack.org/cv/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist