;status equ 0x03 no need to specify - the 877a.inc file contains all the system registers
;trisc equ 0x87
;portc equ 0x07
list p=16f877A ; list directive to define processor
#include <p16f877A.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _XT_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF
; __config 3f39 ?? this selects the RC osc, Watchdog Enabled and LVP on - which you do not want
; use the full version as above so you can always see what bits you have set
cblock 0x20 ; specify user registers
d1,d2,d3 ; delay work files
endc
org 0x0000
goto main
#include delay.inc
main call sys_init
call led_on
led_on
loop movlw 0xff
movwf portc
call delay
clrf portc
call delay ; also need a delay here otherwise the led will be on all the time
goto loop
sys_init clrf PORTC ; ensure portC is off.
banksel TRISC
clrf trisc
banksel 0
return
end