AtomSoft
Well-Known Member
As i am starting to practice on more chips i use the blink as a start... But i ran into a issue... it doesnt want to blink just stays on solid... and since i can not debug with out a ICD 2 well... i cant debug lol here is my code
Code:
list p=16f627A ; list directive to define processor
#include <P16F627A.inc> ; processor specific variable definitions
__CONFIG 0x3f78 ;_CP_OFF & _DATA_CP_OFF & _LVP_OFF & _WDT_OFF & _INTOSC_OSC_CLKOUT
cblock 0x00
d1
d2
d3
endc
ORG 0x00 ; processor reset vector
Main
clrf PORTA ;Initialize PORTA by setting output data latches
movlw 0x07 ;Turn comparators off and
movwf CMCON ;enable pins for I/O functions
bsf STATUS, RP0 ;select bank 1
movlw 0x1D ;data direction
movwf TRISA ;set PortA all outputs
bsf PCON, 3 ;OSCF: INTOSC oscillator frequency bit: 1=4 MHz typical
bcf STATUS, RP0 ;select bank 0
Loop
bsf PORTA, 1 ;set RA1 High
call Delay
bcf PORTA, 1 ;set RA1 Low
goto Loop ;go back and do it again
Delay
movlw 0x03
movwf d1
movlw 0x18
movwf d2
movlw 0x02
movwf d3
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0
goto $+1
return
END ; directive 'end of program'