This very simple design shows how to make a blinking LED using PIC16F684
Assembly code is shown next .You can also dowload a HEX file here. ON/OFF LED frequency can be changed by modifying a delay function.
LIST P=PIC16F684
include P16f684.inc
__CONFIG _CP_OFF & _WDT_OFF & _BOD_OFF & _PWRTE_OFF & _INTRC_OSC_NOCLKOUT & _CPD_OFF
org 0x00
reset:
goto start
org 0x04
start: bcf STATUS, RP0 ;Bank 0
bcf STATUS, RP1
clrf PORTC ;Clear PORTC
bsf STATUS, RP0
clrf TRISC ;PORTC is OUTPUT
bcf STATUS, RP0
loop:
bsf PORTC,0X05 ;Set RC5 HIGH
call delay
bcf PORTC,0X05 ;Set RC5 LOW
call delay
goto loop
;————————————
delay:
movlw 0xFF
movwf 0x51
CONT1: movlw 0xFF
movwf 0x52
CONT2: decfsz 0x52,f
goto CONT2
decfsz 0x51,f
goto CONT1
return
;————————————
end