>BEGIN >. WHILE forever >. . IF the timer overflow flag is set >. . . Increment Period_Hi >. . IF the event has occurred >. . . Copy the timer contents to Period_Lo >. . . IF the timer overflow flag is set >. . . . Increment Period_Hi >. . . ENDIF >. . . Process the event Period >. . ENDIF >. ENDWHILE >END > >As can be seen a problem can occur when a timer overflow occurs >between checking the overflow bit and reading the timer contents. >Even if the overflow check is done immediately befor or after >reading the timer contents, the broblem will still exist. Peter, consider the following: repeat if overflow then begin hi := hi + 1; clear overflow end{if}; lo := timer until not overflow ___Bob