I'm using 16F so the @reset itīs not possible.
I didnīt try the I/O method because my PCB is done...
I'm using 16F so the @reset itīs not possible.
I didnīt try the I/O method because my PCB is done...
my assumption is by using this method, it jumps only to the reset vector. So it doesn't produce any effects on the registers... so the i/o style should be considered.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yes, I agree with you...
What do you think the ideia to do software reset putting all my registers to zero. Itīs easier and i havenīt to use the I/O method
not sure of it... humm... what is the purpose of this software reset?
What do you expect?
Do you set all your registers at the begining?
Sure you can set all register to the default POR before the goto reset vector ... but those registers are not all to zero... see datasheet for POR setting of each registers.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
The ideia in doing the software reset itīs that:
I have a "security command" and when this contact is closed the circuit workīs normally, but when the contact opens I donīt want that the circuit workīs, but when the contact closes again all my registers goes like it seems we remove the power, like it was the first time we were running the program...
What Iīm thinking to do is modify the value on the registers that I've modified and put them at zero or to the value that had at the beginning!
If you just need to clear all RAM (variables) then use the CLEAR command.
If you want to start over from location 0 simulating a power-up condition, and clear RAM without a hardware reset, then use;
@ clrf PCLATH
@ goto 0
And place CLEAR as the first BASIC instruction.
If you have a security check routine that needs to clear RAM when a switch changes state, use the CLEAR command on entry to the routine.
Lots of options.
Thankīs, your solution works.
I was forgetting the clear command...
The code to do a software reset is:
clear
@ clrf PCLATH
@ goto 0
Best regards
Leonel
Bookmarks