Shop OBEX P1 Docs P2 Docs Learn Events
stamp killing power to itself (clarified) — Parallax Forums

stamp killing power to itself (clarified)

ArchiverArchiver Posts: 46,084
edited 2001-03-26 08:52 in General Discussion
Chris-

Here's one way to approach this problem. Consider that you have two
states. Let's define state A as the Stamp being without power.
Let's define state B as the Stamp being connected to power. Let's
also define two logical variables: accessory (accessory power
present) and powerdown (a Stamp output level).

While in state A, you transition to state B only when the accessory
line is high. While in state B, you transition to state A only when
the Stamp asserts powerdown. Transistions from A to B ignore the
Stamp's powerdown level, and transistions from B to A ignore the
accessory level. OK so far?

While in state A, detecting a high on the accessory line is pretty
straightforward.

To control the Stamp's powerdown assertion while in state B, I'd
connect a Stamp I/O pin (the source of the powerdown output) to the
Stamp's power source through a ~4.7K pullup resistor. When power is
(re)applied to the Stamp, the pin is high because all pins assume an
input state upon powerup until your program directs otherwise. When
your Stamp decides it's time time to turn itself off, it can make the
pin a low output. That's your powerdown assertion that gets you back
to state A.

Now to implement this logical model, lets's say that a relay is open
while in state A, and closed while in state B. The relay switches
power to your Stamp (maybe a switching transistor would be
better--perhaps others can make a suggestion). The relay's
coil/transistor's base would be enabled if in state A and the
accessory line goes high, and disabled if in state B and the Stamp's
powerdown output goes low. You'd need some logic gates or other
external hardware to complete the hardware implementation and control
the relay/transistor. Seems like it oughta work.


Regards,

Steve

On 25 Mar 01 at 1:08, christopher bergeron wrote:

> To clarify my last statement: I want the shutdown to
> actually run a routine. Therefore the "clarified"
> pseduocode is:
>
> Main:
> do a bunch
> of stuff here
> Loop:
> if button1 = 1 then Shutdown
> if button2 = 1 then blahblah
> goto Loop
>
> Shutdown:
> send "XXX" to serial port
> pause 2000
> ??? <
what to do here???
>

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-03-25 10:08
    To clarify my last statement: I want the shutdown to
    actually run a routine. Therefore the "clarified"
    pseduocode is:

    Main:
    do a bunch
    of stuff here
    Loop:
    if button1 = 1 then Shutdown
    if button2 = 1 then blahblah
    goto Loop

    Shutdown:
    send "XXX" to serial port
    pause 2000
    ??? <
    what to do here???

    blahblah:
    debug "blahblah",cr


    I'm trying to kill power to the stamp so that when
    it's next started it will begin at the top (Main[noparse]:)[/noparse].

    So when power gets cut, the stamp will tell everyone
    he's getting ready to shut down; they will do what
    they need to, and it will turn off (GET turned off).
    That is the goal. I'm just not quite sure what the
    outcome is going to be when I kill the power to the
    stamp (via a transistor/relay combo) _using the
    stamp_. The only reason I'm concerned is that it's
    [noparse][[/noparse]relatively] odd to take the power out from under
    something that is causing the "take power out" to
    occur. Does this make any sense or have I had too
    much to drink? Perhaps both?

    At any rate -
    If I send a BS2 pin high to trigger a relay that kills
    power to the stamp, will it osscilate or something
    wierd, or will it do what I expect?

    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-25 13:12
    >To clarify my last statement: I want the shutdown to
    >actually run a routine. Therefore the "clarified"
    >pseduocode is:
    >
    >Main:
    *SNIP*

    >I'm trying to kill power to the stamp so that when
    >it's next started it will begin at the top (Main[noparse]:)[/noparse].
    >

    You will need a relay that is controlled by the Stamp to
    supply power to the Stamp through its contacts. You
    will also need a pushbutton or switch in parallel with
    the relay contacts to get the Stamp to start. Then the
    first line in the program should be one to energise the
    relay so that you can let go of the button.
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-26 02:52

    Original Message
    From: <carl@g...>
    To: <basicstamps@yahoogroups.com>
    Sent: Sunday, March 25, 2001 4:12 AM
    Subject: Re: [noparse][[/noparse]basicstamps] stamp killing power to itself (clarified)


    >>SNIP<<
    >
    > You will need a relay that is controlled by the Stamp to
    > supply power to the Stamp through its contacts. You
    > will also need a pushbutton or switch in parallel with
    > the relay contacts to get the Stamp to start. Then the
    > first line in the program should be one to energise the
    > relay so that you can let go of the button.
    >

    I was thinking about the stamp driving a relay also, but there are two
    relays. One is to turn itself off. To restart it, a start button is
    pressed. The relay that turns it on has a set of contacts that holds itself
    on, and to turn it off, that holding circuit is interrupted. Those who are
    familiar with industrial controls or ladder logic will recognize this as a
    basic start/stop control.
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-26 03:40
    There should be no problem if you put in enough delay in the
    relay or FET power off so that the source of power to the
    stamp goes to 1 volt or less [noparse][[/noparse]capacitors discharge in power
    supply etc.] or if you make it so that the FET feeding power
    to the stamp can only be on when the stamp has power - i.e.
    to start the stamp you have to bypass the FET which switches
    power to the stamp and then the stamp sets a pin high to hold
    it's own power on. When this stamp pin goes off so does the
    FET feeding the power to the stamp and the whole thing dies
    until reset.

    This type of thing is done all the time - consider when you
    open a clothes dryer door and then have to push a button
    to start again when the door is shut... :-)

    > Date: Sun, 25 Mar 2001 01:08:53 -0800 (PST)
    > From: christopher bergeron <christopher_bergeron@y...>


    >To clarify my last statement: I want the shutdown to
    >actually run a routine. Therefore the "clarified"
    >pseduocode is:

    >Main:
    >do a bunch
    >of stuff here
    > Loop:
    > if button1 = 1 then Shutdown
    > if button2 = 1 then blahblah
    > goto Loop

    >Shutdown:
    > send "XXX" to serial port
    > pause 2000
    > ??? <
    what to do here???

    What you do here is turn OFF the pin which is holding the
    power to the stamp ON. Then the ON set needs to be
    long enough for this pin to be set high to hold on.

    >I'm trying to kill power to the stamp so that when
    >it's next started it will begin at the top (Main[noparse]:)[/noparse].

    You might do better to just put in a RESET pulse to the
    stamp: [noparse][[/noparse]ground pin mclr #28 DIP] To assure it resets -
    otherwise you rely on the start reset circuitry to work.

    Empiricism rules - why don't you try something? :-)
    If it oscillates it will be interesting debugging it...

    Have fun... premena

    ________________________________________________________________
    GET INTERNET ACCESS FROM JUNO!
    Juno offers FREE or PREMIUM Internet access for less!
    Join Juno today! For your FREE software, visit:
    http://dl.www.juno.com/get/tagj.
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-26 04:36
    I still don't see why all this is needed, they are great suggestions, but if
    the stamp shuts itself off, it can't turn itself back on again.

    just use the car's accessory line to drive a relay or anything like that to
    control power to the stamp. Its simple, saves an IO line, and the stamp
    can be turned back on easy.

    -Rob

    Original Message
    From: "s premena" <premzee@j...>
    To: <basicstamps@yahoogroups.com>
    Sent: Sunday, March 25, 2001 9:40 PM
    Subject: [noparse][[/noparse]basicstamps] RE:stamp killing power to itself (clarified)


    > There should be no problem if you put in enough delay in the
    > relay or FET power off so that the source of power to the
    > stamp goes to 1 volt or less [noparse][[/noparse]capacitors discharge in power
    > supply etc.] or if you make it so that the FET feeding power
    > to the stamp can only be on when the stamp has power - i.e.
    > to start the stamp you have to bypass the FET which switches
    > power to the stamp and then the stamp sets a pin high to hold
    > it's own power on. When this stamp pin goes off so does the
    > FET feeding the power to the stamp and the whole thing dies
    > until reset.
    >
    > This type of thing is done all the time - consider when you
    > open a clothes dryer door and then have to push a button
    > to start again when the door is shut... :-)
    >
    > > Date: Sun, 25 Mar 2001 01:08:53 -0800 (PST)
    > > From: christopher bergeron <christopher_bergeron@y...>
    >
    >
    > >To clarify my last statement: I want the shutdown to
    > >actually run a routine. Therefore the "clarified"
    > >pseduocode is:
    >
    > >Main:
    > >do a bunch
    > >of stuff here
    > > Loop:
    > > if button1 = 1 then Shutdown
    > > if button2 = 1 then blahblah
    > > goto Loop
    >
    > >Shutdown:
    > > send "XXX" to serial port
    > > pause 2000
    > > ??? <
    what to do here???
    >
    > What you do here is turn OFF the pin which is holding the
    > power to the stamp ON. Then the ON set needs to be
    > long enough for this pin to be set high to hold on.
    >
    > >I'm trying to kill power to the stamp so that when
    > >it's next started it will begin at the top (Main[noparse]:)[/noparse].
    >
    > You might do better to just put in a RESET pulse to the
    > stamp: [noparse][[/noparse]ground pin mclr #28 DIP] To assure it resets -
    > otherwise you rely on the start reset circuitry to work.
    >
    > Empiricism rules - why don't you try something? :-)
    > If it oscillates it will be interesting debugging it...
    >
    > Have fun... premena
    >
    > ________________________________________________________________
    > GET INTERNET ACCESS FROM JUNO!
    > Juno offers FREE or PREMIUM Internet access for less!
    > Join Juno today! For your FREE software, visit:
    > http://dl.www.juno.com/get/tagj.
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-03-26 08:52
    A simple idea would be to use a two-coil bistable relay. The "on" signal
    draws current thru one coil, which sets the relay contacts in one direction,
    and thus switches on power to the circuit. The Stamp can draw current thru
    the other coil, which sets the relay contacts in the other direction, which
    switches off the power. Voil
Sign In or Register to comment.