first off all you forgot to clear int flag
in your int handler so your PIC will always
be in interrupt routine. you have to put line
before retfie instruction.
also I suggest you to turn on and off
LED in int routine with little delay
in between (although it is not adviceable to use
delays in interrupt)
to see the interrupt more clearly. you can
use this int handler for example:
Code:
asm
int_handler
; Save Resisters ;
movwf wsave ; Save W Register into wsave
swapf STATUS,W ; Save STATUS Register into ssave
clrf STATUS
movwf ssave
movf PCLATH,W ; Save PCLATH Register into psave
movwf psave
movf FSR,W ; Save FSR Register into fsave
movwf fsave
endasm
high LED
pause 100
low LED
; Interrupt Code ;
;bsf _LED ; Turn on LED
asm
; Restore Resisters ;
movf fsave,W ; Restore FSR Resister
movwf FSR
movf psave,W ; Restore PCLATH Resister
movwf PCLATH
swapf ssave,W ; Restore STATUS Resister
movwf STATUS
swapf wsave,F ; Restore W Resister
swapf wsave,W
bcf INTCON,1
retfie
endasm
Bookmarks