---------- > From: Andrew Warren > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: Tmr1 interrupt on a 16C73 > Date: Thursday, March 20, 1997 6:15 PM > > Mayes uk wrote: > > > I am having problems with the interrupt on Tmr1 on a C73. > > > > I have it configured to interrupt from a RC0, I set Tmr1H > > and Tmr1L to $FF. > > > > The first time a +ve edge comes along I get the interrupt, > > which is then followed by 3 other +ve edges, I do what I have > > to do, then on leaving the interrupt handler set Tmr1H and > > Tmr1L back to $FF and clear the Tmr1IF ready for the next time. > > > > The next +ve edge comes along and gets ignored. The one after > > that causes an interrupt and off I go, but this time I am > > one edge out of sync. > > > > Anyone got any ideas? > > Mike: > > Is it possible that, rather than ignoring 3 edges while you're in > your interrupt service routine, you're actually ignoring FOUR? If > you're still in the interrupt routine when the edge you want comes > through, clearing the TMR1IF flag will keep it from being processed. > > I don't know how you're ignoring those three edges, but if you're > actually counting those edges in the ISR, you should clear the TMR1IF > flag IMMEDIATELY after seeing the third ignored edge. That way, if > the fourth edge comes through before you exit the ISR, it'll generate > an interrupt as soon as your RETFIE is executed. > > Did that make sense? If not, let me know and I'll rephrase it... I'm > pretty tired right now. > > -Andy > > === Andrew Warren - fastfwd@ix.netcom.com > === Fast Forward Engineering, Vista, California > === http://www.geocities.com/SiliconValley/2499