I need help with programming the pic16f684 using assembly
i need to program it to control the led flashing rate which is connect it to pic RC5
i manage to find the code to flash the led and i tried it on my circuit and its working fine
the only thing now i need is the code to control the flashing rate using potentiometer wish is connect it to pin RA1
Mod edit: code tags
i need to program it to control the led flashing rate which is connect it to pic RC5
i manage to find the code to flash the led and i tried it on my circuit and its working fine
the only thing now i need is the code to control the flashing rate using potentiometer wish is connect it to pin RA1
Code:
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
