Wavelength
New Member
Guys...I got this code from this web site **broken link removed**.
Anyway the problem is I just want to test it using MPLAB sim.During simulation run the green arrow will reach the "Loop1" then move to "goto" and back to "Loop1" only, it wont move on to other codes.Is there something wrong with the code or when I burn the program into the PIC will it act diffrently on practical run? Im trying to learn about creating a delay on a program.Thnx
STATUS equ 03h
TRISA equ 85h
PORTA equ 05h
COUNT1 equ 08h
COUNT2 equ 09h
bsf STATUS,5
movlw 00h
movwf TRISA
bcf STATUS,5
Start movlw 02h
movwf PORTA
call Delay
movlw 00h
movwf PORTA
call Delay
goto Start
Delay
Loop1 decfsz COUNT1,1
goto Loop1
decfsz COUNT2,1
goto Loop1
return
end
Anyway the problem is I just want to test it using MPLAB sim.During simulation run the green arrow will reach the "Loop1" then move to "goto" and back to "Loop1" only, it wont move on to other codes.Is there something wrong with the code or when I burn the program into the PIC will it act diffrently on practical run? Im trying to learn about creating a delay on a program.Thnx
STATUS equ 03h
TRISA equ 85h
PORTA equ 05h
COUNT1 equ 08h
COUNT2 equ 09h
bsf STATUS,5
movlw 00h
movwf TRISA
bcf STATUS,5
Start movlw 02h
movwf PORTA
call Delay
movlw 00h
movwf PORTA
call Delay
goto Start
Delay
Loop1 decfsz COUNT1,1
goto Loop1
decfsz COUNT2,1
goto Loop1
return
end