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.
Software reset.
Moderator: Benj
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Steve
- Matrix Staff
- Posts: 3434
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Re: Software reset.
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.
Note that this suggestion is for code only. I'm not sure it is possible in simulation.
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times