There are any way to do a software reset, not an hardware reset?
There are any way to do a software reset, not an hardware reset?
By software only ... no.... and yes.
If you connect one extra i/o to your MCLR pin... yes
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
What your saying is to connect, for example, porta.1 to MCLR pin and "write" porta.0 = 0 to make a software reset?!
yep. just make sure your PORTA.1 is set to high or as input when you boot the pic and that's it.
EDIT: i don't know if it's working but i just read my 18F2320 datasheet about the STKPTR register. Probably you can set the stack register full and do few gosub to get a Stack Full Resets too. never tested it. i'll try this now and let you know.
Last edited by mister_e; - 21st February 2005 at 19:32.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Mouhaha it's working
it never jump to 'there' or 'there2' and for sure 'there3'Code:' program to perfom an software reset ' PIC18F2220 DEFINE LOADER_USED 1 DEFINE OSC 20 DEFINE HSER_RCSTA 90h DEFINE HSER_TXSTA 24h DEFINE HSER_BAUD 9600 loop var byte begin: STKPTR = 0 ' clear Stack resets bits hserout ["software RESET",13,10] start: for loop = 10 to 0 step -1 hserout ["reset in ",dec loop,13,10] pause 1000 next STKPTR = $FF ' full stack pointer gosub there pause 1000 goto start there: hserout ["I'm supposed to be die now ;o("] pause 1000 gosub there2 return there2: hserout ["I'm supposed to be die now for the 2nd time ;o("] pause 1000 gosub there3 return there3: hserout ["I'm supposed to be die now for the 3rd time ;o("] pause 1000 return
cool stuff!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
if you're using an 18F type pic, you can just use the reset command.
@ reset
if using a 16F,
asm
clrf PCLATH
goto 0
endasm
Darrel
DT
@ reset
yup... always read the whole datasheet.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks