-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, ~From the errata, what I remember is that the problem occurs if you try to use the shadow registers to save context and an interrupt occurs in a MOVFF, possibly only a MOVFF involving one of the shadowed registers. The two options to avoid this are: (1) don't use the shadow registers; that is, do explicit context-saving in the high-priority interrupt just like the low priority, or (2) as the first instruction in your high-priority interrupt vector, do a FAST CALL to the actual interrupt handler; this fast call causes the shadow registers to be resaved with the proper values (and of course is *not* occurring during a MOVFF - it's occurring during a CALL, which is fine); the call blows away the existing saved values and replaces them with new values which will normally be exactly the same, except for when you hit the MOVFF bug in which case the saved values will be the correct values Given either of these two workarounds (I like the second - it still gives you essentially all the advantages of the shadow registers), I understand you can still use MOVFF anywhere you want. Chris James Hillman wrote: | Ok, this time with the question... | | How should contexts be safely saved in a low priority interrupt when a high | priority interrupt is also used (on a pic 18f)? | The examples given in various datasheets and the example template are shown | at the end, but I have also read that it is not a good idea to use the movff | instruction if an interrupt could occur in the middle (of the movff | instruction). Therefore if high priority interrupts are enabled, surely it | would be safer to save contexts this way: | [snip] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: GnuPT 2.7.2 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFICV8BiD2svb/jCb4RAgNbAJ9AiXgJ+29v1777vB6easvreL8cxQCfcQEq u9EXVpfqkuNyJeSPMnBUhLM= =57j1 -----END PGP SIGNATURE----- -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist