> w_temp EQU 0x20 > MyVars EQU 0xA0 > > MainCode > banksel MyVars ;set up for bank 1 read > > Interrupt happens here ;instructions save W into wrong > bank (MyVars) first off. > 0x004 movwf w_temp > ... ;much other overhead can't > possibly recover 0xA0 value. > > movf MyVars,w ;old MyVars was clobbered. You either have to reserve the W save area at the same offset in all banks, or in the global RAM from 70h - 7Fh. See my interrupt template module QQQ_INTR.ASPIC at http://www.embedinc.com/pic. > INT_VECTOR CODE 0x004 ; interrupt vector location > movwf w_temp ; save off current W register > contents > movf STATUS,w ; move status register into W > register > bcf STATUS,RP0 ; ensure file register > bank set to 0 No, it doesn't. You also need to set RP1 to ensure that. I do a CLRF STATUS here to set everything to bank 0 in one instruction. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics