Hello Everyone,

I'm trying to inicialize in programming with interrupts.

I've read lots of posts and try to adapt my way.

Here is my sample code (PIC 16F628A):

Test1:
Pause 500 ' Wait for LCD to startup
Lcdout $FE, 1, "Test" ' Clear LCD screen

Sleep:
TrisB = %01000001
OPTION_REG.7=0
OPTION_REG.6=0 'Trig on falling

INTCON.1 = 0
INTCON.4 = 1

@ SLEEP
@ NOP
@ NOP
PAUSE 500

Lcdout $FE, 1, " Wakeup" ' Clear LCD screen
pause 1500
goto Test1


The program display "Test" and wait. After RB0 interrupt occurs, the display will change to "Wakeup" and after 1,5 sec. it display again "Test" and wait once more for RB0 interrupt.

The interrupt RB0 works fine the first time, but after that enters in sleep mode and never get out of sleep.

Could anyone help me out?

Thanks,
Nuno