Shop OBEX P1 Docs P2 Docs Learn Events
instruction execution times... — Parallax Forums

instruction execution times...

ArchiverArchiver Posts: 46,084
edited 2003-04-18 14:54 in General Discussion
Hi,
A question:

If I have a PULSOUT instruction, does the stamp wait the duration of
the pulse before executing the next instruction? i.e., if I have a
simple loop to flash an LED, such as:

Loop:
PULSOUT 13, 2000
Pause DelayTime
GOTO Loop

Does the value of the Pulse duration (2000 in this case) affect the
length of time it takes the loop to execute?

Thanks,
Jeff

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-04-17 22:10
    Yup. The STAMP does timing via program loops, not interrupts - it waits for
    the period to elapse before going on to the next statement.

    At 08:56 PM 4/17/2003 +0000, you wrote:
    >Hi,
    > A question:
    >
    >If I have a PULSOUT instruction, does the stamp wait the duration of
    >the pulse before executing the next instruction? i.e., if I have a
    >simple loop to flash an LED, such as:
    >
    >Loop:
    > PULSOUT 13, 2000
    > Pause DelayTime
    > GOTO Loop
    >
    >Does the value of the Pulse duration (2000 in this case) affect the
    >length of time it takes the loop to execute?
    >
    >Thanks,
    > Jeff
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

    Larry Bradley
    Orleans (Ottawa), Ontario, CANADA
  • ArchiverArchiver Posts: 46,084
    edited 2003-04-18 14:54
    Yes, the Stamp2 does ONLY one thing at a time, and
    until that thing is done the next instruction DOES
    NOT Execute. So instructions with 'durations'
    (like PULSOUT, SEROUT, SERIN with a timeout,
    even SLEEP and PAUSE) will run to completion before
    any following instruction executes.

    This is both a little irritating (I'd LOVE to multi-task)
    and reassuring (it is a simple model, easily worked with).

    --- In basicstamps@yahoogroups.com, "bisbeejeff" <kennedy@t...> wrote:
    > Hi,
    > A question:
    >
    > If I have a PULSOUT instruction, does the stamp wait the duration
    of
    > the pulse before executing the next instruction? i.e., if I have a
    > simple loop to flash an LED, such as:
    >
    > Loop:
    > PULSOUT 13, 2000
    > Pause DelayTime
    > GOTO Loop
    >
    > Does the value of the Pulse duration (2000 in this case) affect the
    > length of time it takes the loop to execute?
    >
    > Thanks,
    > Jeff
Sign In or Register to comment.