Heinz Czychun wrote: > Once an interrupt (any interrupt) forces execution of the interrupt > service routine the interrupt enable bits become useful flags to tell > which peripheral's service request should be honoured. Yes, if your code enables/disables specific interrupts on the fly. Most PIC projects use a fixed set of interrupts. In that case you don't need to check any IE bits because any condition that could cause a interrupt is always enabled. Even if your code enables/disables some interrupts, you only have to check the IE bits of those interrupts in the interrupt routine before reacting to their IF bits. > But now the > interrupt flag bits (all that are set) become significant and cannot > be ignored. No. Only the ones that might be enabled (have their IE bits set). > Whether the peripheral's interrupt enable bit is set or > not it's interrupt flag bit must be cleared or the processor will be > hung repeatedly reentering the interrupt service routine. No. If a peripheral's IE bit is cleared, that peripheral will not cause a interrupt. The IF bit of such a peripheral is irrelevant to the interrupt routine. In fact, it would be bad for the interrupt routine to clear such IF bits because that peripheral might be used via polling in the foreground code. Here is the interrupt routine code snippet for checking for the timer 0 interrupt when this could be enabled/disabled on the fly: ; ; Check for timer 0 rollover. This interrupt could be disabled. ; btfss intcon, t0ie ;timer 0 interrupt enabled ? goto no_tmr0 ;no btfsc intcon, t0if ;timer 0 didn't interrupt ? goto intr_tmr0 ;did interrupt, go service it no_tmr0 ;timer 0 didn't do it ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist