Clear the T0IF then RETFIE and in the main loop, SLEEP. The CPU will shit down and do nothing till the next interrupt. On Sun, Oct 2, 2016 at 8:17 PM, Bob LeDoux wrote: > This should be a simple problem, but I've missed the solution. > > I'm programming a 16F684 in assembler. > > TMR0 interrupts every 4 milliseconds-1:16 prescaler. It is used to time > data input. > > A branch of the program processes in a few microseconds. I want the > program to wait until the next interrupt occurs. > > If I don't clear the TOIF flag before the RETFIE instruction the interrup= t > repeats in a continuous loop. > > I could monitor TMR0 and wait until it reaches 0xff--that would be close > enough. > > But there should be some other way. Any ideas? > > -- > 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 .