I need to get a pulse for every one second.until now i got that with delay loops,listed below.now i have to take that pulse from TMR0 without delay loops.how to do that?how the code comes?what is the meaning of prescaler?
I'm using 4mhz cystal-PIC16F84A.
I'm using 4mhz cystal-PIC16F84A.
Code:
Delay MOVLW 03h
MOVWF 1Ah
Delay1 DECFSZ 1Bh,1
GOTO Delay1
DECFSZ 1Ch,1
GOTO Delay1
DECFSZ 1Ah,1
GOTO Delay1
RETURN
Code:
cblock
d1
d2
d3
endc
;999997 cycles
movlw 0x08
movwf d1
movlw 0x2F
movwf d2
movlw 0x03
movwf d3
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0
;3 cycles
goto $+1
nop
return