IVP wrote 2012-03-16 07:56: >> Apart from being messy, I'm wondering would it be really bad >> programming to disable interrupts actually inside the interrupt >> routine, and re-enable them in the main routine > > No, I do that in several programs. Just use RETURN instead of > RETFIE and.re-enable by setting GIE. I don't consider it 'messy' > at all, but do remember to clear any pending IRQ sources before > re-enabling if necessary if you don't want the ISR to be entered > immediately, just as if this was during power-up initialisation But if the main goal is to actualy delay pending interrupts, you do not want to clear them, of course. If it is OK to actuly miss interrupts, then it's OK. I guess that usualy you simply want to delay interrupts while some "interrupt-unfriedly" code runs, but you do not want to miss interrupts. Jan-Erik. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .