Help required detecting difference between power-on & reset states
Hi all,
I'm currently working on an SX/B application running on the SX48 protoboard.
Does anybody know how to tell (via software SX/B or ASM) whether the SX has just been powered
on or whether the reset button has been pressed ?
I've tried using the NOSTARTUP option in SX/B to stop the registers from being cleared when SX/B starts up, but what I see
is the registers actually remember their last values, even when the power has been removed for a while ! I expected them
to have random values in them.
The next part of the problem for me is to detect if the SX has just been switched on or the WATCHDOG event has
triggered a reset. Does anybody know how to detect if a WATCHDOG reset has occured ?
Many thanks for any help.
Tony
I'm currently working on an SX/B application running on the SX48 protoboard.
Does anybody know how to tell (via software SX/B or ASM) whether the SX has just been powered
on or whether the reset button has been pressed ?
I've tried using the NOSTARTUP option in SX/B to stop the registers from being cleared when SX/B starts up, but what I see
is the registers actually remember their last values, even when the power has been removed for a while ! I expected them
to have random values in them.
The next part of the problem for me is to detect if the SX has just been switched on or the WATCHDOG event has
triggered a reset. Does anybody know how to detect if a WATCHDOG reset has occured ?
Many thanks for any help.
Tony
Comments
Here is the info.
http://www.parallax.com/dl/appnt/sx/An18Reset.pdf
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject my reality, and substitute yours." NOT Mythbusters
·
Cheers
Tony
Watch out for any outputs when going into sleep mode (Or any other reset for that matter).
You need to study the table in detail to notice there can be some gotcha's. Note that·output registers
are not specifically cleared on a startup, however the pin directions are all set to inputs, so output values
can be lost.·Basically you will need to·cache the output values before sleep, or reset...
-Dan
·