LIST P=PIC16F88
include <P16f88.inc>
org 0x00
__CONFIG _CONFIG1, _LVP_OFF &_WDT_OFF &_PWRTE_OFF &_CP_OFF & _INTRC_IO
reset:
nop
goto start
org 0x20
start:
; CONFIGURATION*-*-*-*-*-*-*-*-*-
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
; used_ registers:
MUX_sel EQU H'0021' ; MUX select value
del1 EQU H'0030' ; for delay
del2 EQU H'0031' ; for delay
to_transmit EQU H'0050' ; data register
led1 EQU H'0070' ; for led delay
demo_tr EQU H'0072' ; demo transmit
loop_mux EQU H'0074' ; demo transmit
; oscillator
banksel OSCCON ; 8M internal clk, mode defined
movlw 0b01110100 ; by fosc(2:0), ??????
movwf OSCCON ; system clock source from main oscillator
; led
BANKSEL PORTB ; select bank of PORTA
CLRF PORTB ; Initialize PORTA by
banksel ANSEL ; Configure all pins as digital inputs
clrf ANSEL
banksel TRISB
clrf TRISB ; make PORTB output
; MAIN PROGRAM*-*-*-*-*-*-*-*-*-*
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Led_flicker:
banksel PORTB
bsf PORTB,3
bcf PORTB,2
CALL DELAY
bsf PORTB,2
bcf PORTB,3
goto Led_flicker
;---end Led flicker
; END MAIN PROGRAM*-*-*-*-*-*-*-*-*-*
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
DELAY:
movlw 0xFF
movwf del1
movlw 0xFF
movwf del2
loopa:
decfsz del1, f
goto loopa
loopb:
decfsz del2, f
goto loopb
return
end