khatus
Member level 3
Hello guys this is the code for blink led in mplab ide using assembly language. But unfortunately, when i tried to simulate it in proteus it did not run
Here is my complete code
Here is the simulation result in mplab
And here is my proteus simulation result.
What is the problem??
Here is my complete code
Code:
#include "p16f84a.inc"
; CONFIG
; __config 0x3FFF
__CONFIG _FOSC_EXTRC & _WDTE_ON & _PWRTE_OFF & _CP_OFF
RES_VECT CODE 0x0000 ; processor reset vector
GOTO START ; go to beginning of program
; TODO ADD INTERRUPTS HERE IF USED
MAIN_PROG CODE ; let linker place main program
STATUS equ 03h;
TRISA equ 85h;
PORTA equ 05h;
COUNT1 equ 08h;
COUNT2 equ 09h;
;****set up the ports****
BSF STATUS, 5;
MOVLW 00h;
MOVWF TRISA;
BCF STATUS,5;
;*****TURN the led on*********
START
MOVLW 02h
MOVWF PORTA;
LOOP1
DECFSZ COUNT1,1;
GOTO LOOP1;
DECFSZ COUNT2,1;
GOTO LOOP1;
;***Delay finished, now turn the led off***
MOVLW 00h;
MOVWF PORTA;
;***ADD another delay***
LOOP2
DECFSZ COUNT1,1;
GOTO LOOP2;
DECFSZ COUNT2,1;
GOTO LOOP2;
;****Get back to the start of the program;
GOTO START;
END
And here is my proteus simulation result.
What is the problem??