On Sat, 2005-03-05 at 23:51 -0500, Jason Graham wrote: > To Roy, > > I'm not sure I understand what you are trying to do. Your interrupt can > >occur > >while your program is doing anything, anywhere in the code. You want to > >respond to the interrupt and rather than return to where the interrupt > >occurred > >you want to jump to some other specific location in the program. Yes? > >Why? > > > You got it...something wrong with that? It's just the way it has ta be. First off, with an attitude and response like that you're giving people VERY little reason to give up there time for free to help you. Second, to answer your question, yes, it's possible there IS something wrong with that. If that's the sort of behaviour you want it SOUNDS like either you are approaching the problem in a non conventional way (not always a bad idea) or you shouldn't be using an interrupt to begin with. Can you at least elaborate as you WHY this behaviour is "just the way it has ta be"? Now, to get back to things, you say you want the interrupt to "return" to a specific point. That makes it sound to me that you DON'T want normal "interrupt" behaviour, you want more like a vectored jump. This is certainly possible, and even useful in some circumstances, but to call it an "interrupt" will confuse people. Are you using assembler? If so the solution is easy: simply don't do a RETFIE, instead do a GOTO (or BRA depending on your MCU of choice) to your label. Be aware that this sort of structure will do BAD stuff with your stack, so you must be VERY careful about ANY returns in your code (i.e. disabling interrupts completely when doing a call). I'd actually recommend avoiding returns completely if possible, just to much of a recipe for disaster. If you are using a compiled language I'd say you're stuck: I can't think of a way to get most compilers I've see to do what you want. About the only thing I can think of is to have the ISR set a flag that the main routine samples and branches if set. This sort of behaviour is "common", but I don't know if it'll do what you want. In the future in might be a good idea to be a little nicer to the people you are asking help from. ----------------------------- Herbert's PIC Stuff: http://repatch.dyndns.org:8383/pic_stuff/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist