>-----Original Message----- >From: Dwayne Reid [mailto:dwayner@PLANET.EON.NET] >Sent: 24 June 2004 05:24 >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: [PIC]: Mysterious INTCON troubles with PIC16F877 > > >At 08:33 PM 6/23/2004, adastra wrote: > >>This is inside an ISR and is intended to set a flag and clear a >>register after counting down a number of TMR0 overflows. > >I see 2 possible problems: you don't appear to clear the TMR0 >interrupt flag (T0IF), and you end the routine with >instead of . > >dwayne The instructions: movlw b'01110000' movwf INTCON ; and re-enable external interrupt should clear the T0IF flag. However, it also enables the external interrupt and peripheral interrupts are enabled. The context save code is also not shown, nor any handler for the other interrupts that may be enabled. The ISR also "returns" (not setting GIE) with apparently no context restore code, is the code snippet shown actually CALLed from the main ISR? Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu