PA3040
Advanced Member level 3
Dear all,
I wrote a program for interrupt. so it is working well for my demo board but when I debug the program using my PICkit2 clone it does not interrupt
please advice
I wrote a program for interrupt. so it is working well for my demo board but when I debug the program using my PICkit2 clone it does not interrupt
please advice
Code:
status equ 0x03
portb equ 0x06
trisb equ 0x86
portc equ 0x07
trisc equ 0x87
portd equ 0x08
trisd equ 0x88
option_reg equ 0x81
intcon equ 0x0b
temp_w equ 0x23
temp_sta equ 0x24
#include <p16f877a.inc>
__config 3f39
org 0x000
stsrt clrwdt
goto main
org 0x004
goto isr
goto check
main clrwdt
call sys_init
call check
check
loop1 goto loop
loop goto loop1
isr movwf temp_w
swapf status,w
movwf temp_sta
movlw 0xff
movwf portc
swapf temp_sta,w
movwf status
swapf temp_w,f
swapf temp_w,w
bcf intcon,0 ;RBIF
retfie
sys_init bsf status,5 ;BANK1
clrf trisc
clrf trisd
movlw b'11110000'
movwf trisb
bcf option_reg,7;RBPU
bcf status,5 ;BANK0
bsf intcon,7 ;GIE
bsf intcon,3 ;RBIE
movlw 0xf0
movwf portb
clrf portc
clrf portd
bcf intcon,0 ;RBIF
return
end