BS2 - PULSOUT - time between pulses
curious1
Posts: 104
Hello,
· I cannot find in the WAM or Command Ref. the time frame between pulses if no Pause command is given.
I assume that it is 1 ms, this being the units for the pause command.
for instance :
·· low 1
·· for counter = 1 to 1000
·· Pulsout 1,1
·· next
The pulses in this pulse train would be high for 2us and low for ???, 1ms ???
If so, is there a method to make it pulse faster ?
Thanks,
RC
Post Edited (curious1) : 4/24/2007 12:59:14 AM GMT
· I cannot find in the WAM or Command Ref. the time frame between pulses if no Pause command is given.
I assume that it is 1 ms, this being the units for the pause command.
for instance :
·· low 1
·· for counter = 1 to 1000
·· Pulsout 1,1
·· next
The pulses in this pulse train would be high for 2us and low for ???, 1ms ???
If so, is there a method to make it pulse faster ?
Thanks,
RC
Post Edited (curious1) : 4/24/2007 12:59:14 AM GMT
Comments
Your code does in fact produce 2us pulses 1ms apart (on a BS2)·measured using a BS logic analyser. It would appear that the shortest program loop on a BS2 is 1ms. In the processor comparison chart the BS2 is rated at ~4,000 instructions/sec. The BS2px is rated at ~19,000 instructions/sec (currently the fastest Stamp), so I guess that going to a faster processor would be the only way to shorten the width between pulses using the PULSOUT cmd.
Steve
I have·some, (limited) experience with·PLC based··pulse generators ·that operates like this:
A single pulse is described as having a 50% duty cycle. This means it is ON for 50% of the pulse and consequently OFF for the remaining 50% of the pulse. The actual output is·controlled by interrupt handling, i.e. the output cycle is NOT affected by the scan time of the program.
Do you know if any of the Parallax products can be configured to operate this way ?
Thanks again Steve,
RC
There is more about the timing of the interpreter here: www.emesys.com/BS2speed.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
·· Thanks for the link, much useful info. I will have to modify my plans.
I will experiment with the stamps "unconventional" PWM, on / off pulses as short as 1.6us in duration.
May have to ask you about the "TRICK WAYS" that you mentioned.
Thanks again for the direction,
RC
·
There is also
I think TOGGLE takes the same time as HIGH or LOW.
As example of a PWM trick, the following gives a sequence of 8 equally spaced pulses in a period of 1.15 millisecond (BS2)
The pulses are always 4.5 microseconds long, and the low periods are long, 278.5 microseconds each. That would probably work to advance a stepper controller. The pin is left as an input at the conclusion of the command, so you may want to use a pulldown resistor depending on what the pin is driving.
The following gives 8 pulses over a period of 4.6 milliseconds
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com