Heinz Czychun wrote: >> then you may find all kinds of other IFs, like INT0IF, set >> if you look for them. But they are of no consequence if you are not >> interested in them as interrupt sources. > > I disagree here they, the IFs, are very significant because you won't > get out of the isr without clearing them. This is wrong. If an IE bit is not set, you can safely ignore the corresponding IF bit. This IF bit won't generate an interrupt; this is why you can ignore it and exit the interrupt routine with the bit set. > I think that's why uChip has added an on bit to most (all?) > peripherals, so they never can set their IFs when off, so don't need > to be dealt with in the isr. Timer0 being a legacy sort of > peripheral (the first one?) doesn't have such a nicety. Difficult to know why Microchip does things, but in general the peripheral enable bits serve the purpose of reducing current draw if you don't need that peripheral. It's simple, and it seems you haven't "got" it yet... If you want to enable/disable an interrupt in firmware, you need to look at both IE and IF bits for that interrupt in the interrupt routine when deciding whether to execute the associated interrupt action. For all interrupts that are always enabled (in your firmware), you just need to look at their IF bit in the interrupt routine when deciding whether to execute the associated interrupt action. For all other interrupts (that is, the ones you don't need), it is safe (and the usual thing to do) to just ignore their IF bit (and of course make sure their IE bit is 0). Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist