Shop OBEX P1 Docs P2 Docs Learn Events
Help required detecting difference between power-on & reset states — Parallax Forums

Help required detecting difference between power-on & reset states

Tony LeylandTony Leyland Posts: 71
edited 2006-06-29 16:32 in General Discussion
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

Comments

  • BeanBean Posts: 8,129
    edited 2006-06-28 15:56
    Tony,
    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
    ·
  • Tony LeylandTony Leyland Posts: 71
    edited 2006-06-29 12:09
    Thanks Bean, that's a very handy App Note.

    Cheers
    Tony
  • dkemppaidkemppai Posts: 315
    edited 2006-06-29 16:32
    Tony Leyland said...
    Thanks Bean, that's a very handy App Note.

    Cheers
    Tony
    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
    ·
Sign In or Register to comment.