avinsinanan
New Member
Hello,
I wrote some code and becasue of the four lines with the asterisks (*), my program keeps on restarting ( It keeps on going back to the line ORG )x00, nop ).
Without the four lines it gives a one second delay. Why does it keep restarting with the four lines?
INCLUDE <P16f877.inc>
LIST P=16F877
count EQU 0x26
five EQU 0x27
ORG 0x00
nop
goto main
ORG 0x10
main
BANKSEL OPTION_REG *
movlw B'00100001' ;*enable counter mode, 1:4 prescaler
movwf OPTION_REG ;*increment on rising edge
BANKSEL TMR0*
movlw D'250'
movwf count
movlw 0x10
movwf five
point decfsz five
goto start
goto here2
start movlw D'249'
here addlw 0xFF
btfss STATUS,Z
goto here
decfsz count
goto start
goto point
here2 movf TMR0,W
clrf TMR0
movwf PORTD
stop sleep
END
Yours Respectfully
Avin Sinanan
I wrote some code and becasue of the four lines with the asterisks (*), my program keeps on restarting ( It keeps on going back to the line ORG )x00, nop ).
Without the four lines it gives a one second delay. Why does it keep restarting with the four lines?
INCLUDE <P16f877.inc>
LIST P=16F877
count EQU 0x26
five EQU 0x27
ORG 0x00
nop
goto main
ORG 0x10
main
BANKSEL OPTION_REG *
movlw B'00100001' ;*enable counter mode, 1:4 prescaler
movwf OPTION_REG ;*increment on rising edge
BANKSEL TMR0*
movlw D'250'
movwf count
movlw 0x10
movwf five
point decfsz five
goto start
goto here2
start movlw D'249'
here addlw 0xFF
btfss STATUS,Z
goto here
decfsz count
goto start
goto point
here2 movf TMR0,W
clrf TMR0
movwf PORTD
stop sleep
END
Yours Respectfully
Avin Sinanan