Ladies and Gents,

Before the site was compromised there was a thread about using a 12F683 and getting ON INTERRUPT to work that was started by tracecom. At least I think that's who it was. Henrick commented often along with others. I'm trying to somewhat recreate that thread in an effort to learn something useful. If I screwed up who did what I apologize. If I left you out, again apologies, please chime in and hopefully this thread won't get lost.

Even incorporating all those suggestions for setting WDT and empty or populated main loops, I couldn't get the darned thing to work in Proteus. It's a simple circuit with an LED in series with a resistor connected to pin 7, GPIO.0, with the other end tied to ground and MCLR tied to +V thru a 10k resistor on pin 4, GPIO.3, and that's it.

My intent with this thread to learn/understand how to use ON INTERRUPT. However, using the code presented previously I could never get the LED to flash during the ISR. Henrik foresightedly put blink pattern during PIC start that enabled you to see the PIC started but the ISR didn't work. Proteus informed you when the processor was reset by the WDT if the WDT was ON.

The code I came up with worked only after I set Bit 6 on T1CON to enable the Timer1 Gate Enable bit.
Code:
define OSC 8         ' just cause                                              
osccon = %01110110

ansel = 0           ' all ports digital
cmcon0 = 7        ' comparators off
T1CON = %00001001 ' for me this was the real problem -- Bit 6 to be exact
                             ' code I copied had TMR1 ON but gate enable was OFF
	                ' setting Bit 6 to 1 stops ISR
INTCON = %11000000 ' Enable GIE and PIE
PIE1 = %00000001   ' TMR1 Overflow Enable bit enabled

                   ' thanks for whomever pointed out the info files as the 
                   ' following is copied straight from them
#CONFIG            
    __config  _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_ON & _CP_OFF
#ENDCONFIG

i var byte
on interrupt goto SLOOP

for i = 0 to 10  'flash rapily with different on off
    high gpio.0  ' so I was sure it was doing this not ISR
    pause 200
    low gpio.0
    pause 100
'    toggle gpio.0 ' this is the way tracecom and Henrik did it
'    pause 100
next

main:              'mainloop with or without something in it
     pause 1      ' WDT ON w/empty main loop causes resets
                     ' WDT OFF w/empty or w/populated mainloop works
GOTO MAIN      ' do it forever

     disable   ' manual shows it here but if in ISR it still worked
SLOOP:              'isr
      toggle gpio.0  
      PIR1.0 = 0
      resume  ' resume must be before enable
      enable  
end
Maybe I'm doing something wrong or missed the point and if so I'd like to know it, preferrably presented in an easy to understand method, as I can use this stuff in a future project. Is this the proper way to use ON INTERRUPT is the ultimate question.

Another topic during the thread was the location of DISABLE, ENABLE and RESUME. I found DISABLE could be moved around some but RESUME/ENABLE have to be in a specific order. I think I commented it in the code shown.

If I haven't before now I'm going to show my ignorance. How do you know how often an interrupt occurs? I've looked through the data sheet but I've yet to find the answer. I know someone will say RTFDS or some such but I didn't see it.

I realize this thread is bringing much info together and again I hope I got it correct. Thnaks for your time and patience.