Hi all! I'm attempting to use two interrupts - one is on at all times and the other is on only during specific routines. When I first turn on my program and hit a switch, it seems the second interrupt occurs though it should be off. This might be a hardware problem, but I wanted to inquire about turning an interrupt on and off. Here's an example of what I *think* I'm supposed to do:


'PIC18F2525

On Interrupt goto Reset

intcon = %10010000 ' Enable global interrupts and interrupt on RB0

Main:

'Do something here'

'If switch is pushed go to Switched_Pushed

goto Main ' If switch is not pushed, repeat Main routine

Switched_Pushed:

intcon3 = %00001000 ' Enable interrupt on RB1
intcon2.5 = 0 ' Act on falling edge
'Do stuff here, if RB1 goes low, goto Reset

'Do more stuff, if RB1 goes low, goto Reset

goto Main

Disable
Reset:

'Do something here

Resume Over_Here
Enable

Over_Here:

intcon3 = %00000000 ' Turn off interrupt on RB1

goto Main



I notice the PBP manual says you can use On Interrupt more than once. Do I need to add an "On Interrupt goto Reset" before the intcon3 in the Switched_Pushed routine or am I missing something else? Any advice is appreciated.