How many milliseconds does this delay produce:
Code:
[FONT=Verdana][SIZE=2][COLOR=#000000]msec250: ; a subroutine to delay 250 msec
movlw D'250' ; W is changed but no separate register needed
nmsec: ; could call it here with # msec in W
nop ; each nop is 0.122 milliseconds
nop
nop ; each total loop is 8 X 0.122 = 0.976 msec
nop
addlw H'FF' ; same as subtracting 1 from W
btfss STATUS, Z ; skip if result is zero
goto nmsec ; this is 2 X 0.122 msec
return ; back to calling point[/COLOR][/SIZE][/FONT]
Last edited: