Shop OBEX P1 Docs P2 Docs Learn Events
unknown 2.4 Second negative pulse — Parallax Forums

unknown 2.4 Second negative pulse

ArchiverArchiver Posts: 46,084
edited 2003-06-13 20:16 in General Discussion
Hello,

I have a BS2. If I set an I/O pin high (like 'high 8')and then end
the prgoram, I notice on my scope that the I/O pin toggles from high
to low every 2.4 seconds. The duration of the negative pulse is
18.44mS. It will do this on every line I set high. Anyone
know/guess why?

Thanks,
Duane

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-06-13 15:26
    In a message dated 6/12/2003 11:00:28 PM Pacific Daylight Time,
    mtn_biker37@y... writes:

    > Hello,
    >
    > I have a BS2. If I set an I/O pin high (like 'high 8')and then end
    > the prgoram, I notice on my scope that the I/O pin toggles from high
    > to low every 2.4 seconds. The duration of the negative pulse is
    > 18.44mS. It will do this on every line I set high. Anyone
    > know/guess why?
    >
    > Thanks,
    > Duane
    >

    I think somebody posted this before, are you using the sleep command? I thing
    the watchdog timer might me waking up the stamp at your interval. You will
    probably get a definate answer on this from some stamper other than me who
    knows the stam really well.


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-13 16:06
    Hello Duane.

    > I have a BS2. If I set an I/O pin high (like 'high 8')and then end
    > the prgoram, I notice on my scope that the I/O pin toggles from high
    > to low every 2.4 seconds. The duration of the negative pulse is
    > 18.44mS. It will do this on every line I set high. Anyone
    > know/guess why?

    When the program is done and the BS has nothing else to do, it
    automatically enters in sleep mode, even if you didn't include that
    instruction in your code.

    Please look at the SLEEP instruction on the BASIC Stamp Manual for an
    explanation of this interruption.

    The manual will provide a couple of ideas to solve this but keeping the
    low power mode.

    Another simple solution is keeping the BS busy (and awake), when you
    finish the program:
    Do_Nothing:
    GOTO Do_Nothing

    This will prevent the BS to enter in SLEEP mode, and is not a convenient
    solution for battery powered applications.

    Saludos,
    Aristides Alvarez
    International Education Program Developer
    aalvarez@p...
    Parallax, Inc. www.parallax.com
    Rocklin, California
    USA
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-13 16:15
    This is characteristic of the Stamp when it executes the END, SLEEP,
    NAP, POLLWAIT (BS2P), or if a program simply ends. The watchdog
    timer wakes the Stamp up every 2.3 seconds and all the pins
    configured as outputs become inputs for about ~18 milliseconds on the
    BS2. If you put a pullup resistor on that pin that was set HIGH,
    then you won't see the hiccup, that is, unless the pin is driving
    something like and LED. If the hiccup is bad for your system, then
    end the program with STOP instead of END. STOP keeps the clock
    running. Or make a program loop at the end. Or use a pullup
    resistor, or pullup resistor and buffer.

    -- Tracy


    >Hello,
    >
    >I have a BS2. If I set an I/O pin high (like 'high 8')and then end
    >the prgoram, I notice on my scope that the I/O pin toggles from high
    >to low every 2.4 seconds. The duration of the negative pulse is
    >18.44mS. It will do this on every line I set high. Anyone
    >know/guess why?
    >
    >Thanks,
    >Duane
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-13 17:17
    I was unaware of the SLEEP mode. As you suggested, I'll look into it
    tonight when I get home. Thanks for the help.

    Duane


    --- In basicstamps@yahoogroups.com, "Aristides Alvarez"
    <aalvarez@p...> wrote:
    > Hello Duane.
    >
    > > I have a BS2. If I set an I/O pin high (like 'high 8')and then
    end
    > > the prgoram, I notice on my scope that the I/O pin toggles from
    high
    > > to low every 2.4 seconds. The duration of the negative pulse is
    > > 18.44mS. It will do this on every line I set high. Anyone
    > > know/guess why?
    >
    > When the program is done and the BS has nothing else to do, it
    > automatically enters in sleep mode, even if you didn't include that
    > instruction in your code.
    >
    > Please look at the SLEEP instruction on the BASIC Stamp Manual for
    an
    > explanation of this interruption.
    >
    > The manual will provide a couple of ideas to solve this but keeping
    the
    > low power mode.
    >
    > Another simple solution is keeping the BS busy (and awake), when you
    > finish the program:
    > Do_Nothing:
    > GOTO Do_Nothing
    >
    > This will prevent the BS to enter in SLEEP mode, and is not a
    convenient
    > solution for battery powered applications.
    >
    > Saludos,
    > Aristides Alvarez
    > International Education Program Developer
    > aalvarez@p...
    > Parallax, Inc. www.parallax.com
    > Rocklin, California
    > USA
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-13 18:48
    As Tracy says, end your program with 'STOP'
    or an infinite loop, and you won't see this.
    However, the BS2 will remain in 'high-power'
    mode, such as it is.

    End your program with 'END', and you will
    see this, but the BS2 will use less power.


    --- In basicstamps@yahoogroups.com, "mtn_biker37" <mtn_biker37@y...>
    wrote:
    > Hello,
    >
    > I have a BS2. If I set an I/O pin high (like 'high 8')and then end
    > the prgoram, I notice on my scope that the I/O pin toggles from
    high
    > to low every 2.4 seconds. The duration of the negative pulse is
    > 18.44mS. It will do this on every line I set high. Anyone
    > know/guess why?
    >
    > Thanks,
    > Duane
  • ArchiverArchiver Posts: 46,084
    edited 2003-06-13 20:16
    I was unaware of the SLEEP mode. As you suggested, I'll look into it
    tonight when I get home. Thanks for the help.

    Duane


    --- In basicstamps@yahoogroups.com, "Aristides Alvarez"
    <aalvarez@p...> wrote:
    > Hello Duane.
    >
    > > I have a BS2. If I set an I/O pin high (like 'high 8')and then
    end
    > > the prgoram, I notice on my scope that the I/O pin toggles from
    high
    > > to low every 2.4 seconds. The duration of the negative pulse is
    > > 18.44mS. It will do this on every line I set high. Anyone
    > > know/guess why?
    >
    > When the program is done and the BS has nothing else to do, it
    > automatically enters in sleep mode, even if you didn't include that
    > instruction in your code.
    >
    > Please look at the SLEEP instruction on the BASIC Stamp Manual for
    an
    > explanation of this interruption.
    >
    > The manual will provide a couple of ideas to solve this but keeping
    the
    > low power mode.
    >
    > Another simple solution is keeping the BS busy (and awake), when you
    > finish the program:
    > Do_Nothing:
    > GOTO Do_Nothing
    >
    > This will prevent the BS to enter in SLEEP mode, and is not a
    convenient
    > solution for battery powered applications.
    >
    > Saludos,
    > Aristides Alvarez
    > International Education Program Developer
    > aalvarez@p...
    > Parallax, Inc. www.parallax.com
    > Rocklin, California
    > USA
Sign In or Register to comment.