It looks like you're trying to measure a pulse width or time between edges. I like to use the Capture (CCP) for this. Basic idea: Set up capture for falling edge trigger. Loop if a falling edge was captured clear falling edge captured flag process edge endif if a rising edge was captured clear rising edge captured flag process edge endif Endloop (forever) On interrupt: save all registers if this was a falling edge (I keep a bit variable to tell me what I'm looking at) if the edge is still down (it's been about 20uS by the time I get here.. .) record time of the edge (Timer1) set to capture rising edge flag that we are capturing rising edge now flag that a falling edge was captured else nothing - ignore this edge as pulse was too short endif else (it was a rising edge) if edge is still high record time of edge, or Timer1 - stored (falling) edge set to capture falling edge flag that we are capturing falling edge now flag that a rising edge was captured else nothing endif endif clear interrupt flag restore registers retfie At 08:52 AM 3/11/97 -0500, you wrote: >I'm using a 16C74 to do a project where I get the sanitized version of a >real world signal as the input to RB0 (external interrupt). Because this >signal can be noisy, I can receive several edges from one event. To filter >out the extraneous pulses, I decided to disable the external interrupt and >run timer0 for one cycle at maximum scale (gives me a 32msec window where I >can ignore edges). In the interrupt handler for timer0, I turn it off, and >make INTE=1 again. (I'm using timer1 and timer2 for other things already). > >Now this setup works ... most of the time. Every once in a while (probably >15 - 20 seconds), I miss a timer0 interrupt. Which means that I never >reenable RB0, and miss a bunch of legitimate edges. My data collection >routine runs every 8 seconds so when it notices that no edges have been >detected since the last time, it reinitializes and I carry on. However, it >would be better if this didn't happen at all. > >Has anybody else ran into this kind of thing? Any suggestions as to what I >could try? I could just allow all interrupts and filter them after the >fact, but I'd rather just not process the interrupt in the first place. > >thx >rick > > ================================================================== Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865 Hardware & Software for Industry & R/C Hobbies "Go fast, turn right, and keep the wet side down!" ==================================================================