Pulsout - need longer pulse time
Archiver
Posts: 46,084
I'm using a BS2sx and need a longer pulse time than is possible
and do not want to change to a slower Stamp.
Can the equivalent to PULSOUT be programmed using other
command?
Thanks
and do not want to change to a slower Stamp.
Can the equivalent to PULSOUT be programmed using other
command?
Thanks
Comments
HIGH 5
PAUSE 1
LOW 5
The trick is measuring empirically the duration it takes the Stamp to read
the instructions and execute between the HIGH and the LOW. The simplistic
take would be that the above pulse would be 1mS in duration, but that is
almost certainly not true. What's more is that the duration could vary
depending on where the instructions reside in memory (in other words, if the
instructions straddle byte boundaries or not). So What you could do is use
the above fragment and "calibrate" by changing the length of the pause. As
the constant number gets bigger, the timing may change. So PAUSE 100 may not
be 100x longer than PAUSE 1 because the overhead of loading a constant 1 is
probably less than loading a constant 100 (the Stamp uses varying bit
lengths for encoding things).
You could also try to get finer control by using other commands. For
example:
HIGH 5
PAUSE 1
PULSOUT 15,100 ' Pin 15 is not really used -- this is a dummy PULSOUT
LOW 5
This might give you better than 1mS tuning. Of course, it means pin 15 (or
whatever) goes to waste.
Hope that helps.
Al Williams
AWC
*NEW: PAK-XI turns a mouse into an X/Y position sensor
http://www.al-williams.com/pak11.htm
>
Original Message
> From: heatly5 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=pf12VquTG1rufFYEIr6eNJYMRhzVFNP5EWxM-V9ZhpvY8u42VeBOyrolj8N04Wss_Dz1HeCoMBS5w9RkG9LpFnzKUQ]ralph.heatly@l...[/url
> Sent: Friday, November 07, 2003 4:53 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] Pulsout - need longer pulse time
>
>
> I'm using a BS2sx and need a longer pulse time than is
> possible and do not want to change to a slower Stamp. Can the
> equivalent to PULSOUT be programmed using other command?
>
> Thanks
>
>
>
> 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/
>
>
>
>
How long of a pulse do you want and with how much accuracy?
===============================================
I'm using a BS2sx and need a longer pulse time than is possible
and do not want to change to a slower Stamp.
Can the equivalent to PULSOUT be programmed using other
command?
Thanks
______
[noparse][[/noparse]Non-text portions of this message have been removed]
alw@a... writes:
I would guess you could do something like:
HIGH 5
PAUSE 1
LOW 5
The trick is measuring empirically the duration it takes the Stamp to read
the instructions and execute between the HIGH and the LOW. The simplistic
take would be that the above pulse would be 1mS in duration, but that is
almost certainly not true. What's more is that the duration could vary
depending on where the instructions reside in memory (in other words, if the
instructions straddle byte boundaries or not). So What you could do is use
the above fragment and "calibrate" by changing the length of the pause. As
the constant number gets bigger, the timing may change. So PAUSE 100 may not
be 100x longer than PAUSE 1 because the overhead of loading a constant 1 is
probably less than loading a constant 100 (the Stamp uses varying bit
lengths for encoding things).
You could also try to get finer control by using other commands. For
example:
HIGH 5
PAUSE 1
PULSOUT 15,100 ' Pin 15 is not really used -- this is a dummy PULSOUT
LOW 5
This might give you better than 1mS tuning. Of course, it means pin 15 (or
whatever) goes to waste.
Hope that helps.
Al Williams
OR YOU COULD SWITCH TO AN SX BY UBICOM AND HAVE YOUR PULSE OUT ACCURATE TO 20
NANO SECONDS
[noparse][[/noparse]Non-text portions of this message have been removed]