Several people have pointed this out - thank you all. It was meant to check to make sure that GIE was clear before entering the rest of the routine, but I mixed up BTFSC and BTFSS. When fixed, it worked fine. I am not concerned about losing data in the foreground when interrupted. I am just looping and getting interrupted out of the loop. I realize that I will have to make copies of the registers when more processing is added to the loop. I have been reading Myke Predko's book (Programming and Customizing the PICmicro, 2nd Ed), and he explains the way to do this. I haven't used interrupts before, so the interrupt coding is new to me. Thanks, Andy Meng N8MX ----- Original Message ----- From: Olin Lathrop To: Sent: Sunday, August 12, 2001 9:46 AM Subject: Re: [PIC]: USART receive problems > > Interrupt: > > bcf INTCON,GIE > > btfss INTCON,GIE > > goto $ - 2 > > Interrupts are already off by the time you get into the interrupt routine. > Nothing will magically re-enable them. > > > bsf PORTB,LED ; turn on LED > > call Delay15ms > > call Delay15ms > > call Delay15ms > > call Delay15ms > > bcf PORTB,LED > > btfsc PIR1,RCIF ; see if RX flag is set > > call RS232_Receive ; if it is, call RS232_Receive > > retfie > > Read the section about interrupts carefully. You have major misconceptions > here. For example, this interrupt routine will randomly and asynchronously > appear to trash state in the foreground routine. After reading and > understanding the manual, see QQQ_INTR.ASPIC at http://www.embedinc.com/pic > as an example interrupt module. > > > ******************************************************************** > Olin Lathrop, embedded systems consultant in Littleton Massachusetts > (978) 742-9014, olin@embedinc.com, http://www.embedinc.com > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.