From my experience you must turn the intcon_gie off at the begining of the interrupt and not in the main. Else multiple interrupts may occure. Also you don't need to set intcon_gie on in the main because retfie do this job when you go out from ISR Vasile On Wed, 7 Feb 2001, info wrote: > Hi gang > > Having a little Interrupt problems with the f877. 2 days and counting ): > I am using an ice2000 now to try and debug the problem with no joy. > > Basically the GIE bit keeps turning itself off randomly and locking the > code. here is a simplified version of the code. Nops replace the main > program parts to simplify. > ------------------------------- > interupt routine > save context ;obvious > btfsc PIR1,TMR1IF ;tmr1 int > goto timer1overflow > > other interupt stuff > restore context > retfie > timer1overflow > bsf overflowflag ;set tmr1 interupt flag > restore context > retfie > ------------------------------- > START > set ports and normal stuff > set up interupts > BSF INTCON,GIE > > MAIN bcf INTCON,GIE ;turn ints off > nop > check for external signal w ;part of my code > nop > bsf INTCON,GIE ;turn ints on > nop > call loop ;call sub > goto MAIN ;go again > > loop nop > nop > btfss timer1overflowflag ;has tmr1 int > goto loop ;repeat loop > bcf timer1overflowflag ;clr flag > return ;end sub > ----------------------------------- > The program gets stuck in the loop when the GIE bit seems to randomly > clear itself??????? Any ideas > > Scott > > ccessories ) > website: www.broadcastwarehouse.com > email: info@broadcastwarehouse.com > > phone: > sales: > inland (uk) 0208 5409992 > international +44 208 5409992 > tech support: > inland (uk) 0208 5409993 > international +44 208 5409993 > fax inland (uk) 0208 5409994 > international +44 208 5409994 > ******************************************************* > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.