> "Since the upper 16 bytes of all GPR banks are common > in the PIC16F882/883/884/886/887 (see That's true, however, the only consideration is that sometimes you can use the common area for optimized RAM usage - aka to avoid using bank selection code outside of your isr (inside you use the bank0 with Olin's suggestion anyway, so there is no need to waste the common area). Tamas On Thu, Jul 3, 2008 at 11:31 AM, David Meiklejohn wrote: > Alan B. Pearce wrote: > > > > >Certainly reserving the same variables in multiple banks would be > > >wasteful, but as to how precious unbanked memory - surely it depends? > > >It seems to me that using shared memory for context saving is quite > > valid. > > > > You need only 1 byte in shared memory for the interrupt variable save - > > the > > one that saves W. The rest can go in bank 0 if you use Olins > > instruction > > sequence > > Yep, completely understand that, don't disagree - just saying that, if > enough shared registers are available, using them to save context is a > valid > choice. > > > (and I believe this instruction sequence has long been > > advocated by Microchip as well). > > Perhaps, but here's a quote from the 16F887 data sheet (quite recent, from > 2007): > > "Since the upper 16 bytes of all GPR banks are common > in the PIC16F882/883/884/886/887 (see > Figures 2-2 and 2-3), temporary holding registers, > W_TEMP and STATUS_TEMP, should be placed in > here. These 16 locations do not require banking and > therefore, make it easier to context save and restore." > > Now, I'm NOT saying that just because that's what's recommended in the data > sheet, it's what you have to do. Just that Microchip seems to agree with > me > that using shared registers is reasonable. > > > David Meiklejohn > www.gooligum.com.au > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- Rudonix DoubleSaver http://www.rudonix.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist