hi,
i try to test my simple interrupt on my real PIC simulation.
below is my codes:
Code:
led VAR PORTC.4
TRISB.0 = 1 'set port bo to input
ON INTERRUPT GoTo myint ' Define interrupt handler
INTCON = %10010000 'Enable RB0 INTERRUPT
OPTION_REG.6 = 0 'Interrupt on rising edge of RB0/INT pin
loop: High led ' Turn LED on
GoTo loop ' Do it forever
' Interrupt handler
Disable ' No interrupts past this point
myint:
Low led ' If we get here, turn LED off
'Pause 500 ' Pause .5 seconds
INTCON.1 = 0 ' Clear interrupt flag
Resume ' Return to main program
Enable
End
turns out when i enable Pause my interrupt works ok but i turns off pause it wont interrupt at all.
Please help explain what cause the problem.
Bookmarks