Last active
September 14, 2015 17:57
-
-
Save marioIncandeza/5d5e7dad1b5f800f7631 to your computer and use it in GitHub Desktop.
Delay Subroutine for PIC16F887
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Delay subroutine that lasts approximately 0.01 seconds | |
CALL WAIT ;2 | |
WAIT | |
MOVLW 0DH | |
MOVWF OCOUNT | |
MOVLW 0FFH | |
MOVWF ICOUNT ;4 | |
OLOOP | |
NOP ;13 | |
NOP ;13 | |
ILOOP | |
DECFSZ ICOUNT,1 ;(254+2)*13 | |
GOTO ILOOP ;(254*2)*13 | |
DECFSZ OCOUNT,1 ;12+2 | |
GOTO OLOOP ;12*2 | |
RETURN ;2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment