Page 1 of 1

Software reset.

Posted: Mon Sep 07, 2009 9:53 am
by medelec35
How easy is it to include a function block to do a software reset.
I.e a command to go to the beginning of main.
I need to do this from within a macro, but need to clear stack so a call macro would be 1st in the stack.

Re: Software reset.

Posted: Mon Sep 07, 2009 10:10 am
by Steve
Unfortunately, software reset on a PICmicro 16F is not simple. At the basic level, forcing the execution of the ASM "goto 0" code would be a start, but you might also need to set some registers to their default startup values (see the device datasheet for this).

Note that this suggestion is for code only. I'm not sure it is possible in simulation.

Re: Software reset.

Posted: Mon Sep 07, 2009 11:03 am
by medelec35
Steve,
Your soultion was perfect!
Working as intentended.
Thanks...