Hi dearAcetronics.
Thanks alot for your replies. I found a nice PDF on the net about "Using the PORTB Interrupt on Change as an External Interrupt" microchip AN566. I rewote my code:
'************************************************* ****************
'* Initialzation *
'************************************************* ****************
TRISB = %00010000
'************************************************* ****************
'* Interrupt Initialzing *
'************************************************* ****************
OPTION_REG = %10000000
INTCON = %10001000
ON INTERRUPT GOTO DIRECTION
'************************************************* ****************
'* Main Program *
'************************************************* ****************
MAIN:
PAUSEUS 10
lcdout $fe,1
lcdout "Main Routine"
pause 100
GOTO MAIN
END
'************************************************* ****************
'* Interrupt Service Routine *
'************************************************* ****************
DISABLE
DIRECTION:
@ MOVF PORTB,1
INTCON.0 = 0
lcdout $fe,1
lcdout "Interrupt !!!"
PAUSE 100
RESUME
ENABLE
and it worked correct.




Bookmarks