mahesh.gsd
Newbie level 4
hai, i am new to pic 16f84, i program them with RC as a clock source,and i use mplab,recently i thought of using Xtal 4Mhz for flashing an led. but im not able to make it flash led, i have tried even simulating it in proteus, the problem persists, the problem that i see is either the led is turned on constanly or it doesnt glow at all. please help me.
below is the code that i tried to do it. i guess i have given enough delay, correct me if im wrong, and there are not warning errors, and im able to burn the flash with this program, but im not getting the output.
config bits clk - xt, put - on, code protect - off and wdt - off
list p=PIC16F84A
include <P16F84A.INC>
TIME1 EQU 10H
TIME2 EQU 11H
BSF STATUS,5
MOVLW 00H
MOVWF TRISA
BCF STATUS,5
RUN
MOVLW b'00001'
MOVWF PORTA
CALL DELAY
MOVLW b'00000'
MOVWF PORTA
CALL DELAY
GOTO RUN
DELAY
MOVLW 0FFH
MOVWF TIME1
LOOP1
DECFSZ TIME1,1
MOVLW 0FFH
MOVWF TIME2
LOOP2
DECFSZ TIME2,1
GOTO LOOP2
GOTO LOOP1
RETURN
END
below is the code that i tried to do it. i guess i have given enough delay, correct me if im wrong, and there are not warning errors, and im able to burn the flash with this program, but im not getting the output.
config bits clk - xt, put - on, code protect - off and wdt - off
list p=PIC16F84A
include <P16F84A.INC>
TIME1 EQU 10H
TIME2 EQU 11H
BSF STATUS,5
MOVLW 00H
MOVWF TRISA
BCF STATUS,5
RUN
MOVLW b'00001'
MOVWF PORTA
CALL DELAY
MOVLW b'00000'
MOVWF PORTA
CALL DELAY
GOTO RUN
DELAY
MOVLW 0FFH
MOVWF TIME1
LOOP1
DECFSZ TIME1,1
MOVLW 0FFH
MOVWF TIME2
LOOP2
DECFSZ TIME2,1
GOTO LOOP2
GOTO LOOP1
RETURN
END