Shop OBEX P1 Docs P2 Docs Learn Events
Pause — Parallax Forums

Pause

limliklimlik Posts: 23
edited 2009-11-09 02:08 in BASIC Stamp
Is there an alternative way to pause? I need to PAUSE for 10 US (Micro seconds)

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2009-11-07 00:19
    I'm fairly sure you're not going to be able to do that. On a BS2 the quickest commands take about ten times that much time, and even on the faster Stamp chips commands take more than four times that much time.

    Now having said that, someone will pop in here with a brilliant trick to make it work. Just watch.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-11-07 01:11
    "Brilliant trick"...

    Depends what you're trying to accomplish.

    A BS2, 2e, 2pe can PULSOUT in 2us increments, a 2sx, 2p, 2px can PULSOUT in 0.8us increments.
  • JDJD Posts: 570
    edited 2009-11-07 01:55
    Limlik,

    Indeed ,the PULSOUT command can be used in replacement of a PAUSE command; however the PAUSE command doens't effect the I/O line that a PULSOUT command would. That would be something to take into account if you wanted to use the PULSOUT command as apposed to the PAUSE.

    I hope this helps

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-11-07 04:16
    I knew it. Man, if the people in real life* were as smart as you guys, life would be so much easier.

    * You know, the people you have to drive behind, and cope with at the supermarket, and so on.
  • limliklimlik Posts: 23
    edited 2009-11-07 04:45
    lol Thanks [noparse]:)[/noparse] I guess if the commands themselves make that long of a pause just to process then I am good. I just have to
    send an output the raise a pin high for 10 us minimum. I know I could just pause a milliseconds but this needs to be as efficient as possible. From what that command time webpage shows a simple Pin HIGH to Pin LOW takes 140 us each so just setting the Pin low is pause enough.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-11-07 05:00
    "Baking powder?"

    PULSOUT pin, 5 -- That's a 10usec lo-hi-lo transition (assuming the pin is in a Lo state to begin with)·and that's the bottom line on efficiency.
  • limliklimlik Posts: 23
    edited 2009-11-07 05:10
    Issue there is the High phase needs to be no less then 10us that would be 3.3ish us?
  • limliklimlik Posts: 23
    edited 2009-11-07 05:24
    Also another question, can SHIFTOUT send an array?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-07 05:45
    No. SHIFTOUT can only send individual values up to 16 bits. You can list several array elements in one SHIFTOUT statement, but there's no automatic handling of an array. That's not a bad restriction because of the limited number of bytes of variables available on the Stamps. You can also put several SHIFTOUT statements in a row to handle larger amounts of data.
  • limliklimlik Posts: 23
    edited 2009-11-07 06:13
    Hmm so what is a good way to organize the SHIFTIN input? To set variable names for the 3 SHIFTIN's of different values.

    ·
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-11-07 12:34
    First it was a 10us PAUSE, as it turns out you wanted a 10us pulse, and now it's "3.3ish" or something.
    What's going on here?
  • allanlane5allanlane5 Posts: 3,815
    edited 2009-11-07 13:24
    SHIFTIN ShiftPin, MSBFIRST, [noparse][[/noparse]MyVar.HighByte/8, MyVar.LowByte/8, OtherVar/8]
  • ercoerco Posts: 20,256
    edited 2009-11-09 02:08
    re: pauses, Basic Stamps run fairly slowly, and just executing interpreted commands takes time. Just how much time, see great timing info at http://www.emesys.com/BS2speed.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.