Dave, sorry for being only clear as mud with my explaination. I ment to say : because of this, the WD never gets cleared WHILE SLEEPING. When the pic is asleep, WDT overflows thus waking up the PIC.

I tried to quickly look over the program a few posts up, but I don't have a good feel for it yet. I don't think adding the CLRWDT will help only because when the pic wakes, it should be a long time (~2sec) before the next overflow.

I did notice when @SLEEP is used elsewhere in the program, the line following is @NOP. Maybe this is needed to give the pic a chance to get the sleep from its eyes? I would try using @NOP right after the @SLEEP and see if this works.

I have never used any of the power saving modes before, but if the pic needs a nop upon waking up, it may be ignoring the counter=counter+1. Therefore the while is never satisified.

In any event,if the NOP is needed, adding CLRWDT may solve the problem, we just won't know why it did.