> > Questions: > > 1) should I disable GIE in ISR or leave it on? > > Depends on what you need to happen. > > > 2) if I leave it on, if an interrupt occurs during ISR, it will call > > ISR again from start ? > > Yes There seems to be some general confusion here. First, GIE is automatically disabled when the interrupt is taken, so you can't "leave it on". GIE will be re-enabled by RETFIE at the end of the interrupt. You do **NOT** want GIE on in the interrupt routine. This can cause an interrupt within an interrupt. You would have to go thru a lot of trouble to make sure your interrupt routine is re-entrant to handle this case. Think of what your interrupt routine will do to the saved state of the first interrupt if a second one comes along before the first completes. In theory you could make your interrupt routine re-entrant, but I think this is extremely unlikely to be a benefit in practise. Also note that extra call stack locations are used up globally if you allow nested interrupts. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu