|This of course cannot correct for the reset problem the original poster |mentioned, however I have never had that concern (my resets tend to cause |cold boots clearing my RAM and starting scratch). This assumes the increment |code (BumpMyTmr) is atomic, at least as compared to the ReadMyTmr code. I |would be interested in seeing the original posters code, testing for the |various problems (including the reset) can be very tricky. If I recall, the procedure to normalize a stage was something like this: normalize: btfss stagebelow,7 goto clearbelow setbelow: movf thisstage,w iorlw 1 btfsc stagebelow,7 movwf thisstage goto done clearbelow: incf thisstage,w andlw 254 btfss stagebelow,7 movwf thisstage done: I'd have to spend awhile checking all the different cases to make sure I got everything right. Does anyone else know, off hand, whether the "btfsc movwf" sequence is guaranteed to be atomic (i.e. that there would be no possibility of an interrupt changing /stagebelow/ and yet still having the movwf happen)? Attachment converted: wonderland:WINMAIL.DAT 1 (????/----) (000234CE)