I'm new at PICs but not new to coding. If I was attempting this, I would start with a direct solution and then tweak it: 1. Detect switch pressed 2. Pause 400 ms to debounce (assuming Radio Shack tuning fork) 3. Pause 600 ms and periodically check for switch release. If released, it is a 'short press' switch so return. 4. On return, check switch. If it is still closed, then process 'long press' request, else process 'short press' request. This could be done in the main program or as an interrupt. If your program is just ticking over waiting for the switch, then it doesn't need the interrupt. If you are doing magnificent things with the chip while you are waiting for the switch, then set the switch on an external interrupt. If you need help with code for this, I think I could send a short .asm example. If you were looking for something other than what I answered, then please ignore all that preceded. Later, Dan Simple CCS code examples at: http://204.233.101.40/robots/pic1.html >McMeeken writes: >> Any idea where to start writing code to enable a single switch to >>perform two functions? I've seen switches that do one thing if >>pressed >>briefly and another if held down for 1 sec. or more. >> Can this be achieved only with a timer interrupt, or is there a >>better >>way? > >___________________________________________________________________ >Get the Internet just the way you want it. >Free software, free e-mail, and free Internet access for a month! >Try Juno Web: http://dl.www.juno.com/dynoget/tagj.