An enhancement to what Tony says: If you had an extra I/O pin, how about tying it directly to Reset like so: Vdd | | | > PIC | < Reset Pull-Up | > | | _MCLR|----------+ | | Pin|----------+ | Now, When you wanted to reset the device, enable the Pin to be low and the PIC will reset itself. When the PIC resets, all the I/O Ports go back to Input and the _MCLR line goes back up high and you can start executing from the beginning with a reset PIC again. The reset code would be: bcf PORTn, Pin ; Make Sure the Pin is Low bsf STATUS, RP0 bcf TRISn, Pin ; Enable the Pin bcf STATUS, RP0 goto $ The last two instructions would be for "safety", but probably wouldn't be executed. If an open collector (RA4) Pin was used, then the move to Bank1 wouldn't be required and the code would simply be: bcf PORTA, 4 If it's an 18 Pin device, this really gets easy because RA4 is beside _MCLR. myke >If your application originally began from a 'START' address, then if >a reset condition occurred you could GOTO a 'STARTB' address which >can leave some flags in a known state. > >If an input pin going low will cause the reset condition then a flag >could be set indicating the reset. The 'STARTB' address does not >clear this flag, so the normal programs execution will ignore the low input >and clear the flag when this input goes high again. > >Tony > > >Just when I thought I knew it all, >I learned that I didn't. > > "I don't do anything that anybody else in good physical condition and unlimited funds couldn't do" - Bruce Wayne