pic microcontroller discussion list <> wrote on Tuesday, July 15, 2003 12:39 AM: > In the interrupt service routine I test for both CCP2IE and CCP2IF > which are in different banks, meaning I'd like to simplify things a > bit here. My occasional solution to avoid bank switching, when you need a lot of access to a bank 1 SFR, is to use FSR. Save FSR at the top of the ISR, restore it at the end, and before you start the ISR routines, movlw PIE1 movwf FSR Then use INDF to access the various bits of PIE1. I've considered using the method you described, but it seems too likely to process an interrupt when it was disabled, so I always check the enable bit as well. Nigel -- Nigel Orr, Design Engineer nigel@axoninstruments.co.uk Axon Instruments Ltd., Wardes Road,Inverurie,Aberdeenshire,UK,AB51 3TT Tel:+44 1467 622332 Fax:+44 1467 625235 http://www.axoninstruments.co.uk -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu