> Only high priority interrupts are in use, so from what I've read that > means that the appropriate registers get backed up automatically. The If things hasn't changed, the compiler only saves "a basic context" (see section 3.4 of the compiler's manual for a complete list), but for some weird reason it does not consider some registers as PROD, TBLPTR,..., part of the "basic ones", although it uses them at its wild as temporally variables. So you end catched by corrupting them inadvertely. If my memory doesn't leak, the < save = section ("MATH_DATA") > option will instruct the compiler to save all them. > Another related question.... is it safe to modify variables from an > interrupt that are being used in the mainline? Is there any point at > which an undesired value could exist in the register? My interrupt runs It depends ... > a matrix keyboard/LED scanning routine on a timer so that the LEDs are > multiplexed properly. The keyboard data is read in the interrupt and > processed (for debouncing, etc.) in the mainline. But this sometimes > causes erroneous behaviour. ... how you implement it. Oscar -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist