A
Ash
hello
I am relatively new to PIC programming, I have written a short sequence
with a nested loop delay that last about 0.2 seconds
------------------------------------------------------------------------------------------
;SUBROUTINE SECTION.
DELAY MOVLW D'255' ;LOAD 255
MOVWF COUNT1 ;IN COUNT1
LOAD2 MOVLW D'255'
MOVWF COUNT2
DEC2 DECFSZ COUNT2,F
GOTO DEC2
DECFSZ COUNT1,F
GOTO LOAD2
RETURN
------------------------------------------------------------------------------------------------
I need to create a delay of 10 seconds though and have tried to add
another loop to the code by creating a COUNT3 and decrementing it. I
could not get this to work.
I also tried creating another subroutine that called DELAY by simply
going
DELAY2 GOTO DELAY
GOTO DELAY
RETURN
This did not work either. I finally turned to the delay code generator
http://www.piclist.com/techref/piclist/codegen/delay.htm but this also
did not work, and I didn't understand what the command $+2 meant
Can someone help with code for the 10 second delay?
Cheers
Ash
I am relatively new to PIC programming, I have written a short sequence
with a nested loop delay that last about 0.2 seconds
------------------------------------------------------------------------------------------
;SUBROUTINE SECTION.
DELAY MOVLW D'255' ;LOAD 255
MOVWF COUNT1 ;IN COUNT1
LOAD2 MOVLW D'255'
MOVWF COUNT2
DEC2 DECFSZ COUNT2,F
GOTO DEC2
DECFSZ COUNT1,F
GOTO LOAD2
RETURN
------------------------------------------------------------------------------------------------
I need to create a delay of 10 seconds though and have tried to add
another loop to the code by creating a COUNT3 and decrementing it. I
could not get this to work.
I also tried creating another subroutine that called DELAY by simply
going
DELAY2 GOTO DELAY
GOTO DELAY
RETURN
This did not work either. I finally turned to the delay code generator
http://www.piclist.com/techref/piclist/codegen/delay.htm but this also
did not work, and I didn't understand what the command $+2 meant
Can someone help with code for the 10 second delay?
Cheers
Ash