Shop OBEX P1 Docs P2 Docs Learn Events
Reasons For A Restart — Parallax Forums

Reasons For A Restart

John BurrowJohn Burrow Posts: 27
edited 2008-03-10 21:38 in BASIC Stamp
All,

I have figured out that my BS2P will restart for many valid reasons.

So far I know:
1) Power on
2) Reset button pressed
3) Editor downloads (F9)
4) Conected PC boots up/closes down

I would like to be able to tell if the reset was caused by power on (which I'll call a cold start) versus all the others (which I'll call a warm start). I can't see anything in the documentation, and I'm not coming up with any clever ideas (except adding additional external hardware; I'm not willing to do that·right now).

Otherwise, I'm having a ball!

Thanks, John Burrow
San Diego - Warm, Dry and Sunny

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-03-10 20:30
    As far as I know there is no way to have the stamp tell you what caused the reset. The stamp is running a program in rom and when it resets there is no time to do any record keeping.

    Lebanon, OR - Cold, Wet, Cloudy (well not today but quite a bit lately)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • JomsJoms Posts: 279
    edited 2008-03-10 21:38
    Actually I think you could do something external. Use a very low power reed relay with a capacitor across the coil and tie it to the VDD so it is using the regulator that is built onto the basic chip. Make sure that the reed relay does not exceed the current that the regulator is capable of putting out but that is why it needs to be a low power reed relay. Hook the contacts of the relay to a pin in and you should be able to code something so if the pin is low when the chip starts it knows it was a cold start then goes high after half a second. If the pin is already high when the program starts you should be able to know that it was a warm start.

    There are probably many ways of doing it but just an idea of a work around that came to mind. Not sure if it will work in real use but sounds good in theory...
Sign In or Register to comment.