Next problem though has got me. decfsz count_ts ; decrease counter if not zero Your comments are slightly wrong, decfsz means decrement then skip if result is zero. ; addlw .0 ; put 0 in w reg This will add 0 to w, not set w to 0. movlw 0 is one way to set w to 0. xorlw count_ts ; is counter at 0 btfsc status,Z bcf flag,0 ; yes so set flag,0 to 0 ; You could try to following instead of the code you have above: decfsz count_ts goto NextStage bcf flag,0 NextStage ..... I think that should work instead of your code. Kieran