John Payson wrote: > What's the best way of doing a context save/restore if an ISR needs > to use TABLRD [in ROM-only systems] or else both TABLRD and TABLWT > [in systems with external RAM]? John: TABLWT can also be used in systems with external FLASH or EEPROM, and even in systems with NO external memory at all, since the PIC17s can write to their own internal EPROM. > According to what others have posted, the 17Cxx uses seperate > latches for the table-read and table-write instructions. As far as I can tell, this is false. > Does this mean that the only way to put something into the > table-read latches is to read it from memory? If so, is there any > good way to accomplish this other than [in a RAM-based system] > doing something like: > > SAVE: > save a copy of the current table pointer > point to a spare spot in RAM > save the contents of the table-read latches > do a table-write (to record the contents of the write > latches) > > RESTORE: > point to another spare spot in RAM > put the saved table-read latch contents into the write > latches do a table write, followed by a table read put the > saved table-write latch contents into the write latches > > That seems ickly. Is there a better way? Since there's only one latch, it shouldn't be QUITE that icky... But it still doesn't look easy. I haven't yet needed to read from program-space memory in an interrupt routine, but I'm not looking forward to trying. -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499