generating constant output of pulses from BS2
Another approach: a FOR-NEXT loop that never ends. I do this to
myself (unintentionally) more often than I'd like to admit. Just
make your end-value larger than your FOR variable can hold:
i VAR NIB
FOR i = 0 TO 20
(do whatever)
NEXT i
This FOR-NEXT never ends, because i never reaches 20 (it can only get
as large as 15). So:
FOR i = 0 TO 20
OUTA = %1100 >> (i // 4)
PAUSE INB * 100
NEXT
That will put the bit pattern out on pins 0-3 at a speed determined
by the value presented on pins 4-7.
Regards,
Steve
On 2 Mar 04 at 16:37, cnc002@a... wrote:
> Hello guys:
>
> Is there any way other than using PULSOUT and a continuous goto
> command to generated a constant output of pulses from the BS2.
>
> What I am wanting to do is create a quadrature encoder emulator
> using the Stamp. I can create the 90 degree phase shift for the A
> and B signals easily enough using a D type flip flop and would like
> to be able to control the frequency of the signals using inputs to
> the Stamp to select a fast speed and then a slow speed pulse plus
> one inverted pulse to simulate reverse direction of the encoder.
>
> I have played around with the BS2 but nothing really heavy and it
> seems that it would be a perfect replacement for all the CMOS
> discreet chips that are required to create the circuit I am
> describing. I have done this with 14xxx series CMOS chips already
> but would love to be able to simply modify certain parameters with
> software in the Stamp rather than having to change out wiring or
> other components to do it.
>
> Any suggestions or assistance will be greatly appreciated.
>
> Randy Abernathy
> 4626 Old Stilesboro Road NW
> Acworth, GA 30101-4066
> Phone / Fax: 770-974-5295
> Mobile: 678-772-4113
> E-mail: cnc002@a...
>
> I furnish technical support, repair, and other related services for
> your industrial woodworking machinery. My background as Senior
> Service Engineer for the SCMI Group for nearly fifteen years with
> factory training, combines with my extensive background in
> electronics, mechanics, pneumatics, electrical and CNC machinery to
> offer you needed support for your machinery.
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>
> 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.
>
> Yahoo! Groups Links
>
>
>
>
>
myself (unintentionally) more often than I'd like to admit. Just
make your end-value larger than your FOR variable can hold:
i VAR NIB
FOR i = 0 TO 20
(do whatever)
NEXT i
This FOR-NEXT never ends, because i never reaches 20 (it can only get
as large as 15). So:
FOR i = 0 TO 20
OUTA = %1100 >> (i // 4)
PAUSE INB * 100
NEXT
That will put the bit pattern out on pins 0-3 at a speed determined
by the value presented on pins 4-7.
Regards,
Steve
On 2 Mar 04 at 16:37, cnc002@a... wrote:
> Hello guys:
>
> Is there any way other than using PULSOUT and a continuous goto
> command to generated a constant output of pulses from the BS2.
>
> What I am wanting to do is create a quadrature encoder emulator
> using the Stamp. I can create the 90 degree phase shift for the A
> and B signals easily enough using a D type flip flop and would like
> to be able to control the frequency of the signals using inputs to
> the Stamp to select a fast speed and then a slow speed pulse plus
> one inverted pulse to simulate reverse direction of the encoder.
>
> I have played around with the BS2 but nothing really heavy and it
> seems that it would be a perfect replacement for all the CMOS
> discreet chips that are required to create the circuit I am
> describing. I have done this with 14xxx series CMOS chips already
> but would love to be able to simply modify certain parameters with
> software in the Stamp rather than having to change out wiring or
> other components to do it.
>
> Any suggestions or assistance will be greatly appreciated.
>
> Randy Abernathy
> 4626 Old Stilesboro Road NW
> Acworth, GA 30101-4066
> Phone / Fax: 770-974-5295
> Mobile: 678-772-4113
> E-mail: cnc002@a...
>
> I furnish technical support, repair, and other related services for
> your industrial woodworking machinery. My background as Senior
> Service Engineer for the SCMI Group for nearly fifteen years with
> factory training, combines with my extensive background in
> electronics, mechanics, pneumatics, electrical and CNC machinery to
> offer you needed support for your machinery.
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
>
>
>
> 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.
>
> Yahoo! Groups Links
>
>
>
>
>
Comments
Is there any way other than using PULSOUT and a continuous goto command to
generated a constant output of pulses from the BS2.
What I am wanting to do is create a quadrature encoder emulator using the
Stamp. I can create the 90 degree phase shift for the A and B signals easily
enough using a D type flip flop and would like to be able to control the
frequency of the signals using inputs to the Stamp to select a fast speed and
then a
slow speed pulse plus one inverted pulse to simulate reverse direction of the
encoder.
I have played around with the BS2 but nothing really heavy and it seems that
it would be a perfect replacement for all the CMOS discreet chips that are
required to create the circuit I am describing. I have done this with 14xxx
series CMOS chips already but would love to be able to simply modify certain
parameters with software in the Stamp rather than having to change out wiring or
other components to do it.
Any suggestions or assistance will be greatly appreciated.
Randy Abernathy
4626 Old Stilesboro Road NW
Acworth, GA 30101-4066
Phone / Fax: 770-974-5295
Mobile: 678-772-4113
E-mail: cnc002@a...
I furnish technical support, repair, and other related services for your
industrial woodworking machinery. My background as Senior Service Engineer for
the
SCMI Group for nearly fifteen years with factory training, combines with my
extensive background in electronics, mechanics, pneumatics, electrical and CNC
machinery to offer you needed support for your machinery.
[noparse][[/noparse]Non-text portions of this message have been removed]
controlling your A and B pins in a top down programming approach and then
jumping back up to the top will introduce a delay or 'glitch' resulting
in a quadrature pattern that isn't symmetrical.
i.e. this is what you don't want....
START:
LOW A
LOW B
HIGH A
LOW B
HIGH A
HIGH B
LOW A
HIGH B
goto START
What might be a better solution is to have a lookup table something like...
MainLoop:
LOOKUP index,[noparse][[/noparse]00,10,11,01],Pins
OUT Pins
{delay loop here}
if direction = 1 then
index = index + 1
else
index = index - 1
end if
goto MainLoop
...The idea here is that each level of qadrature transition 'sees' the
same amount of delay.
-Beau Schwabe
>Hello guys:
>
>Is there any way other than using PULSOUT and a continuous goto command to
>generated a constant output of pulses from the BS2.
>
>What I am wanting to do is create a quadrature encoder emulator using the
>Stamp. I can create the 90 degree phase shift for the A and B signals easily
>enough using a D type flip flop and would like to be able to control the
>frequency of the signals using inputs to the Stamp to select a fast speed
>and then a
>slow speed pulse plus one inverted pulse to simulate reverse direction of the
>encoder.
>
>I have played around with the BS2 but nothing really heavy and it seems that
>it would be a perfect replacement for all the CMOS discreet chips that are
>required to create the circuit I am describing. I have done this with 14xxx
>series CMOS chips already but would love to be able to simply modify certain
>parameters with software in the Stamp rather than having to change out
>wiring or
>other components to do it.
>
>Any suggestions or assistance will be greatly appreciated.
>
>Randy Abernathy
>4626 Old Stilesboro Road NW
>Acworth, GA 30101-4066
>Phone / Fax: 770-974-5295
>Mobile: 678-772-4113
>E-mail: cnc002@a...
>
>I furnish technical support, repair, and other related services for your
>industrial woodworking machinery. My background as Senior Service Engineer
>for the
>SCMI Group for nearly fifteen years with factory training, combines with my
>extensive background in electronics, mechanics, pneumatics, electrical and
>CNC
>machinery to offer you needed support for your machinery.
bschwabe@a... writes:
This is possible, but what you must take into consideration is that simply
controlling your A and B pins in a top down programming approach and then
jumping back up to the top will introduce a delay or 'glitch' resulting
in a quadrature pattern that isn't symmetrical.
i.e. this is what you don't want....
START:
LOW A
LOW B
HIGH A
LOW B
HIGH A
HIGH B
LOW A
HIGH B
goto START
What might be a better solution is to have a lookup table something like...
MainLoop:
LOOKUP index,[noparse][[/noparse]00,10,11,01],Pins
OUT Pins
{delay loop here}
if direction = 1 then
index = index + 1
else
index = index - 1
end if
goto MainLoop
...The idea here is that each level of qadrature transition 'sees' the
same amount of delay.
-Beau Schwabe
Beau:
Yep, that is exactly why I am looking for another way to do it.
Randy Abernathy
4626 Old Stilesboro Road NW
Acworth, GA 30101-4066
Phone / Fax: 770-974-5295
Mobile: 678-772-4113
E-mail: cnc002@a...
I furnish technical support, repair, and other related services for your
industrial woodworking machinery. My background as Senior Service Engineer for
the
SCMI Group for nearly fifteen years with factory training, combines with my
extensive background in electronics, mechanics, pneumatics, electrical and CNC
machinery to offer you needed support for your machinery.
[noparse][[/noparse]Non-text portions of this message have been removed]
you'll have to use a continuous 'goto' command
to generate continuous pulses.
Beau's Lookup approach is quite ingenious,
actually, since he found a way to make every
cycle around the loop the same number of instructions,
regardless of the output data.
You'll have to experiment with 'PAUSE' values to
get the timing you are looking for.
--- In basicstamps@yahoogroups.com, cnc002@a... wrote:
> Hello guys:
>
> Is there any way other than using PULSOUT and a continuous goto
command to
> generated a constant output of pulses from the BS2.
>
> What I am wanting to do is create a quadrature encoder emulator
using the
> Stamp. I can create the 90 degree phase shift for the A and B
signals easily
> enough using a D type flip flop and would like to be able to
control the
> frequency of the signals using inputs to the Stamp to select a fast
speed and then a
> slow speed pulse plus one inverted pulse to simulate reverse
direction of the
> encoder.
>
> I have played around with the BS2 but nothing really heavy and it
seems that
> it would be a perfect replacement for all the CMOS discreet chips
that are
> required to create the circuit I am describing. I have done this
with 14xxx
> series CMOS chips already but would love to be able to simply
modify certain
> parameters with software in the Stamp rather than having to change
out wiring or
> other components to do it.
>
> Any suggestions or assistance will be greatly appreciated.
>
> Randy Abernathy
> 4626 Old Stilesboro Road NW
> Acworth, GA 30101-4066
> Phone / Fax: 770-974-5295
> Mobile: 678-772-4113
> E-mail: cnc002@a...
>
> I furnish technical support, repair, and other related services for
your
> industrial woodworking machinery. My background as Senior Service
Engineer for the
> SCMI Group for nearly fifteen years with factory training, combines
with my
> extensive background in electronics, mechanics, pneumatics,
electrical and CNC
> machinery to offer you needed support for your machinery.
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]