What you want are commonly called 'flags'. Your interrupt routine sets a flag when it runs. Then your non-interrupt routine periodically checks the flag to see if it i= s set. When the flag is set the normal code then resets the flag and procee= ds to do the procedure you want to run periodically. Then once the procedur= e has completed it returns to whatever else your normal code is doing. Note that you do need to protect against what is known as a 'race condition= '. In the normal code before resetting the flag you need to disable the int= errupt as the check and reset of the flag is not an atomic operation (i.e. = it executes in one instruction that cannot be interrupted). I'll leave it t= o others to provide example code for your chip. >=20 > This should be a simple problem, but I've missed the solution. >=20 > I'm programming a 16F684 in assembler. >=20 > TMR0 interrupts every 4 milliseconds-1:16 prescaler. It is used to time = data > input. >=20 > A branch of the program processes in a few microseconds. I want the > program to wait until the next interrupt occurs. >=20 > If I don't clear the TOIF flag before the RETFIE instruction the interrup= t > repeats in a continuous loop. >=20 > I could monitor TMR0 and wait until it reaches 0xff--that would be close > enough. >=20 > But there should be some other way. Any ideas? >=20 > -- > Bob LeDoux > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .