View Full Version : Pause
11-07-2009, 08:14 AM
Is there an alternative way to pause? I need to PAUSE for 10 US (Micro seconds)
11-07-2009, 08:19 AM
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.
11-07-2009, 09:11 AM
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.
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
11-07-2009, 12:16 PM
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.
11-07-2009, 12:45 PM
lol Thanks :) 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.
11-07-2009, 01:00 PM
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.
11-07-2009, 01:10 PM
Issue there is the High phase needs to be no less then 10us that would be 3.3ish us?
11-07-2009, 01:24 PM
Also another question, can SHIFTOUT send an array?
11-07-2009, 01:45 PM
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.
11-07-2009, 02:13 PM
Hmm so what is a good way to organize the SHIFTIN input? To set variable names for the 3 SHIFTIN's of different values.
11-07-2009, 08:34 PM
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?
11-07-2009, 09:24 PM
SHIFTIN ShiftPin, MSBFIRST, [MyVar.HighByte/8, MyVar.LowByte/8, OtherVar/8]
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."