sush
Member level 4

Led Blink using PIC
hi friends,
can anyone please help me in finding out myh mistake. Actually i'm trying to blink a led using timer 0 of PIC16F628A but can't. here's the code:-
i would appretiate any help, Thank you.
hi friends,
can anyone please help me in finding out myh mistake. Actually i'm trying to blink a led using timer 0 of PIC16F628A but can't. here's the code:-
Code:
LIST p=16F628A ;tell assembler what chip we are using
include "P16F628A.inc" ;include the defaults for the chip
cblock 0x20 ;start of general purpose registers
count1 ;used in delay routine
counta ;used in delay routine
countb ;used in delay routine
endc
org 0x0000 ;org sets the origin, 0x0000 for the 16F628,
GOTO start ;this is where the program starts running
org 0x04 GOTO OVFL_ISR ;this is where the ISR starts running
movlw 0x07
movwf CMCON ;turn comparators off (make it like a 16F84)
initialize
clrf PORTB
bsf STATUS, RP0 ;select bank 1
movlw b'00000000' ;set PortB all outputs
movwf TRISB
bcf STATUS, RP0 ;select bank 0
retlw 0x00
OVFL_ISR
comf PORTB, F
bcf INTCON, T0IE
retfie
start
call initialize
clrf TMR0
clrf INTCON
bsf STATUS, RP0 ;select bank 1
movlw b'00110001'
bsf INTCON, T0IE
bsf INTCON, GIE
Loop
goto Loop ;go back and do it again
end
i would appretiate any help, Thank you.