;HEADER84.ASM
}
tmr0 equ 1 ;tmr0 is file1
STATUS equ 3 ;status is file 3
PORTA equ 5 ;portA is file5
PORTB equ 6 ;portB is file 6
TRISA equ 85H ;trisa portA i/o selection is 85H
TRISB equ 86H ;trisaB portB is i/o selection 86H
option_R equ 81H ;option regester file 81H
zerobit equ 2 ;zero bit is bit 2
count equ 0CH ;count is file 0C regester to count events
;8888888888888888888888888888888888888888888888888888888888
list P=16F84 ; pic being used
org 0 ;start address
GoTo start ;goto start
;88888888888888888888888888888888888888888888888888
; configure bits
-config H'3FF0' ; sets lp oscillator, wdt off, put on,code protect off
;88888888888888888888888888888888888888888888888888888888888
; subroutine section
; 1 second delay
delay1 clrf tmr0 ; start tmr0
loopa movf tmr0,w ; read tmr0 into w
sublw .32 ; time - 32
btfss status,
zerobit ; check time - w = 0
goto loopa ; time is not = 32
retlw 0 ; time is 32 return
;.05 second delay
delayp5 clrf tmr0 ; start tmr0
loopb movf tmr0,w ; read tmr0 into w
sublw .16 ; time - 16
btfss status,
zerobit ; check time-w=0
goto loopb ; time is not =16.
retlw 0 ; time = 16 return
; configuration section
start BSF Status.5 ;turns to bank 1
movlw B'00011111; ;5 bits of port A are I/P
movwf trisa
movlw b'00000000'
movwf trisb ;portb is output
movlw b'00000111' ; prescaler is /256
movwf option-r ; timer is 1/32
bcf status.5 ; return to bank0.
clrf porta ; clears port a
clrf portb ; clears portb
;88888888888888888888888888888888888888888888888888888888
; PROGRAM STARTS NOW
begin bsf portb'0 ; turn on b0
call delayp5 ; wait .5 seconds
bcf portb'0 ; turn off b0
call delayp5 ; wait .5 seconds
goto begin ; repeat
;must end
end
[end code]