ganesh7792
New Member
Hi,
I tried to debug the below code , it seems the Timer interrupt flag is set, however the debugger never seems to go to the interrupt service routine.
Can't MPLAB simulate interrupts?
-Ganesh
I tried to debug the below code , it seems the Timer interrupt flag is set, however the debugger never seems to go to the interrupt service routine.
Can't MPLAB simulate interrupts?
Code:
list p=12F675
#include<p12f675.inc>
RCCAL CODE 0x03ff
res 1
CODE 0x0100
MAIN bsf STATUS,RP0
movwf OSCCAL
;Enable the interrupt by timer
bcf STATUS,RP0
BCF INTCON,2
BSF INTCON,7
BSF INTCON,5
; Enable the timer
bsf STATUS,RP0
BCF OPTION_REG,5
; Set GPIO in output mode
movlw 0x00
movwf TRISIO
goto loop
GRST CODE 0x0000
goto MAIN
ISR CODE 0x0004
bcf STATUS,RP0
; Clear the overflow flag of the timer
BCF INTCON,2
; toggle the 0 bit of GPIO
BTFSS GPIO,0
BSF GPIO,0
BCF GPIO,0
RETFIE
loop nop
goto loop
END
-Ganesh