Reply
Tue 29 Dec, 2015 02:06 am
#include p16F84a.inc
list p=pic16F84A
__config _RC_OSC & _WDT_OFF & _PWRTE_ON & _CP_OFF
count equ 0x21
org 00
goto start
org 0x04
goto interrupt
org 0x22
start:
bsf STATUS,RP0
movlw 0x01
movwf TRISB
bcf OPTION_REG,INTEDG
banksel INTCON
bcf INTCON,INTF
bsf INTCON,INTE
bsf INTCON,GIE
bcf STATUS,RP0
movlw 0xfe
movwf PORTB
SLEEP
goto $-1
interrupt:
initial_loop:
movlw 0x00
movwf count
loop:
incf count,1
btfsc count,3
goto initial_loop
btfss PORTB,0
goto loop
movf count,0
call table_lights
movwf PORTB
bcf INTCON,INTF
bsf INTCON,GIE
retfie
table_lights:
addwf PCL,1
retlw b'00000010'
retlw b'01000100'
retlw b'01010100'
retlw b'10101010'
retlw b'10111010'
retlw b'11101110'
retlw b'01000100'
retlw b'01010100'
retlw b'00000010'
end