Trouble with Pulsin
Archiver
Posts: 46,084
Hey all,
I was just tinkering around when I got the idea to hook up my old R/C
gear to my BS2. I read about how the R/C transmitter talks to the servos
by
pulse commands and so I thought maybe I could get the BS2 to read the
pulse commands from the transmitter and then store it. When I connected
the signal wire from the receiver to the stamp I got totally different
numbers every time I ran the program, which is:
Pulse var word
Main:
Pulsin 0, 1, Pulse
If Pulse = 0 THEN Main
Debug CLS, DEC ? Pulse
Goto main
Pretty straight forward but I just never got the same readings. I
disconnected the signal wire from the receiver but not the stamp while
it was running and by surprise the stamp was still receiving
information. I then disconnected the wire from the stamp and the numbers
stopped. Any help would be greatly appreciated.
Thanx
-Mike
[noparse][[/noparse]Non-text portions of this message have been removed]
I was just tinkering around when I got the idea to hook up my old R/C
gear to my BS2. I read about how the R/C transmitter talks to the servos
by
pulse commands and so I thought maybe I could get the BS2 to read the
pulse commands from the transmitter and then store it. When I connected
the signal wire from the receiver to the stamp I got totally different
numbers every time I ran the program, which is:
Pulse var word
Main:
Pulsin 0, 1, Pulse
If Pulse = 0 THEN Main
Debug CLS, DEC ? Pulse
Goto main
Pretty straight forward but I just never got the same readings. I
disconnected the signal wire from the receiver but not the stamp while
it was running and by surprise the stamp was still receiving
information. I then disconnected the wire from the stamp and the numbers
stopped. Any help would be greatly appreciated.
Thanx
-Mike
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
If the Stamp is in the middle of the `If Pulse = 0 THEN Main' loop
when a pulse-start occurs then the pulse is missed or its width
truncated. As you know the Stamp Pulsin command waits for an
established time and puts 0 into the argument if that time is
exceeded, 131.07ms for BS2e. This could easily happen to the first
pulse in a message burst.
Closely spaced pulses can be missed if they occur while the Debug is
being processed, as Debug is rather slow. Storing the pulse widths
in variables and then displaying with Debug might be a workaround for
this.
I think a good o'scope is required to investigate the data-with-no-
input happening.
It is my experience that Stamp doesn't handle un-clocked serial data
very well, as you are finding out.
Please add timing specs for pulse widths and gap widths if you
respond to this message. I am interested in what you might be trying
to accomplish here.
Al
--- In basicstamps@yahoogroups.com, "Mike Dillon" <laxboy687@e...>
wrote:
> Hey all,
>
> I was just tinkering around when I got the idea to hook up my old
R/C
> gear to my BS2. I read about how the R/C transmitter talks to the
servos
> by
> pulse commands and so I thought maybe I could get the BS2 to read
the
> pulse commands from the transmitter and then store it. When I
connected
> the signal wire from the receiver to the stamp I got totally
different
> numbers every time I ran the program, which is:
>
> Pulse var word
>
> Main:
> Pulsin 0, 1, Pulse
> If Pulse = 0 THEN Main
> Debug CLS, DEC ? Pulse
> Goto main
>
> Pretty straight forward but I just never got the same readings. I
> disconnected the signal wire from the receiver but not the stamp
while
> it was running and by surprise the stamp was still receiving
> information. I then disconnected the wire from the stamp and the
numbers
> stopped. Any help would be greatly appreciated.
>
> Thanx
> -Mike
>
>
>
>
> [noparse][[/noparse]Non-text portions of this message have been removed]
happen because the input impedance of the Stamp is
very high -- therefore a bare, non-driven wire attached
to it acts like an antenna, usually coupling 60 hZ
to the input pin.
Putting a ground wire close to the signal wire helps
reduce the coupling.
Did you have a common ground with the R/C transmitter?
This insures all signals are referenced to the same
ground.
Putting a large value (20K to 100K) resistor to
ground (or +5V) to insure there is a 'hard' value
at the pin even though the wire is floating helps
also.
--- In basicstamps@yahoogroups.com, "aknestaut" <aknestaut@h...>
wrote:
> Mike,
>
> If the Stamp is in the middle of the `If Pulse = 0 THEN Main' loop
> when a pulse-start occurs then the pulse is missed or its width
> truncated. As you know the Stamp Pulsin command waits for an
> established time and puts 0 into the argument if that time is
> exceeded, 131.07ms for BS2e. This could easily happen to the first
> pulse in a message burst.
>
> Closely spaced pulses can be missed if they occur while the Debug
is
> being processed, as Debug is rather slow. Storing the pulse widths
> in variables and then displaying with Debug might be a workaround
for
> this.
>
> I think a good o'scope is required to investigate the data-with-no-
> input happening.
>
> It is my experience that Stamp doesn't handle un-clocked serial
data
> very well, as you are finding out.
>
> Please add timing specs for pulse widths and gap widths if you
> respond to this message. I am interested in what you might be
trying
> to accomplish here.
>
> Al
>
> --- In basicstamps@yahoogroups.com, "Mike Dillon" <laxboy687@e...>
> wrote:
> > Hey all,
> >
> > I was just tinkering around when I got the idea to hook up my old
> R/C
> > gear to my BS2. I read about how the R/C transmitter talks to the
> servos
> > by
> > pulse commands and so I thought maybe I could get the BS2 to read
> the
> > pulse commands from the transmitter and then store it. When I
> connected
> > the signal wire from the receiver to the stamp I got totally
> different
> > numbers every time I ran the program, which is:
> >
> > Pulse var word
> >
> > Main:
> > Pulsin 0, 1, Pulse
> > If Pulse = 0 THEN Main
> > Debug CLS, DEC ? Pulse
> > Goto main
> >
> > Pretty straight forward but I just never got the same readings. I
> > disconnected the signal wire from the receiver but not the stamp
> while
> > it was running and by surprise the stamp was still receiving
> > information. I then disconnected the wire from the stamp and the
> numbers
> > stopped. Any help would be greatly appreciated.
> >
> > Thanx
> > -Mike
> >
> >
> >
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
Al, Thanks for the info on my problem. I did some more research and
found that the R/C receiver sends the servo motors a new pulse every
20ms. I'm thinking that it would be pretty tough to catch the pulses
every time without error.
Plus I don't own an O'scope so maybe ill buy one of those USB O'scopes
on the Parallax website.
Allen, I'm not sure how to go about grounding the pin. I have a very
limited education of electronics so could you perhaps write a schematic
of what you mean?
-Mike
Original Message
From: aknestaut [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=37J4jYSduAGYRmJUADPnGDLxuk07kQHk743-UzE0eQMgAMdSTidYvrWGqyjih9xM43-4Zv_YqSINfX4iIXwKOQ]aknestaut@h...[/url
Sent: Tuesday, March 25, 2003 4:20 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Re: Trouble with Pulsin
Mike,
If the Stamp is in the middle of the `If Pulse = 0 THEN Main' loop
when a pulse-start occurs then the pulse is missed or its width
truncated. As you know the Stamp Pulsin command waits for an
established time and puts 0 into the argument if that time is
exceeded, 131.07ms for BS2e. This could easily happen to the first
pulse in a message burst.
Closely spaced pulses can be missed if they occur while the Debug is
being processed, as Debug is rather slow. Storing the pulse widths
in variables and then displaying with Debug might be a workaround for
this.
I think a good o'scope is required to investigate the data-with-no-
input happening.
It is my experience that Stamp doesn't handle un-clocked serial data
very well, as you are finding out.
Please add timing specs for pulse widths and gap widths if you
respond to this message. I am interested in what you might be trying
to accomplish here.
Al
--- In basicstamps@yahoogroups.com, "Mike Dillon" <laxboy687@e...>
wrote:
> Hey all,
>
> I was just tinkering around when I got the idea to hook up my old
R/C
> gear to my BS2. I read about how the R/C transmitter talks to the
servos
> by
> pulse commands and so I thought maybe I could get the BS2 to read
the
> pulse commands from the transmitter and then store it. When I
connected
> the signal wire from the receiver to the stamp I got totally
different
> numbers every time I ran the program, which is:
>
> Pulse var word
>
> Main:
> Pulsin 0, 1, Pulse
> If Pulse = 0 THEN Main
> Debug CLS, DEC ? Pulse
> Goto main
>
> Pretty straight forward but I just never got the same readings. I
> disconnected the signal wire from the receiver but not the stamp
while
> it was running and by surprise the stamp was still receiving
> information. I then disconnected the wire from the stamp and the
numbers
> stopped. Any help would be greatly appreciated.
>
> Thanx
> -Mike
>
>
>
>
> [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.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/