Shop OBEX P1 Docs P2 Docs Learn Events
PC to stamp2 communication. — Parallax Forums

PC to stamp2 communication.

ArchiverArchiver Posts: 46,084
edited 2001-06-15 02:48 in General Discussion
I'm pretty new to this group and stamps. I have a stamp2 and was
wanting to use it as a interface to my pc. Meaning, I want to create
mini pc controlled robot arm. I am a pretty good C++ and VB
programmer. So last night I wrote a quick program to open an serial
port and send a character to the stamp. When the stamp receives the
character it was to make a sound. Pretty simple, one would think.
It appears that everytime I open the port for communication the stamp
resents. The manual said something like a modification would need to
be made to allow the pc 2 stamp communication to occur, but I didn't
quite understand what change was required. Can someone in the group
HELP????

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-06-12 15:51
    This is answered in the Stamp FAQ at
    http://www.al-williams.com/wd5gnr/stampfaq.htm

    Here's the short answer.

    If you use port 16 (the programming port), the Stamp "steals" -12V from the
    serial receiver. This has a few byproducts:

    1) You can only do half duplex communications
    2) Everything the other computer sends appears to be echoed back -- even if
    the Stamp is "dead" or not listening

    If you don't use port 16 (you can use any pin you like) you have a problem.
    The RS232 standard typically uses +/- 12V (some +/-5V) to represent 1 and 0.
    The Stamp uses 0 and 5V -- not a good match. There are two answers:

    1) Use a converter like a MAX232/MAX232A/MAX233 etc. Or, if you have +/- 12V
    you could use a 1488/1489 combo but for most people the MAX chips are a
    better fit.

    2) Invert the serial output and try to drive the receiver with 0 and 5V. So
    instead of using 84 in the baudmode, you'd add (I think) $4000 to it (check
    the manual). The problem is, not all devices will appreciate this. Also, if
    you want to drive the Stamp from a +/-12V RS232 input, you need a limiting
    resistor (22K) to keep from blowing the Stamp up.

    While this method is not very reliable, I've used it many times and it works
    in nearly all cases.

    Regards,

    Al Williams
    AWC
    * Floating Point A/D:
    http://www.al-williams.com/awce/pak9.htm


    >
    Original Message
    > From: Tim Carroll [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=tpEYg0MlHBQbDpackuVACnWq3Y2ML1n-gOeqkyZdlRwaWiHbR_cofyZmaAbnssA_ydoj3JCsUoQ]ztc0327@y...[/url
    > Sent: Tuesday, June 12, 2001 9:26 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] PC to stamp2 communication.
    >
    >
    > I'm pretty new to this group and stamps. I have a stamp2 and was
    > wanting to use it as a interface to my pc. Meaning, I want to create
    > mini pc controlled robot arm. I am a pretty good C++ and VB
    > programmer. So last night I wrote a quick program to open an serial
    > port and send a character to the stamp. When the stamp receives the
    > character it was to make a sound. Pretty simple, one would think.
    > It appears that everytime I open the port for communication the stamp
    > resents. The manual said something like a modification would need to
    > be made to allow the pc 2 stamp communication to occur, but I didn't
    > quite understand what change was required. Can someone in the group
    > HELP????
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed with. 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/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-15 02:48
    If the stamp is resetting when the COM port opens, isn't this a different
    problem.

    Isn't there something about disconnecting the ATN pin on the Stamp either
    via a switch, or with a decoupling cap he should consider, too? Possibly
    even a software change on the PC to not assert DSR (?) ?? I don't have
    may manuals handy so I can't look this up.

    On Tue, 12 Jun 2001 09:51:33 -0500 "Al Williams" <alw@a...>
    writes:
    > This is answered in the Stamp FAQ at
    > http://www.al-williams.com/wd5gnr/stampfaq.htm
    >
    > Here's the short answer.
    >
    > If you use port 16 (the programming port), the Stamp "steals" -12V
    > from the
    > serial receiver. This has a few byproducts:
    >
    > 1) You can only do half duplex communications
    > 2) Everything the other computer sends appears to be echoed back --
    > even if
    > the Stamp is "dead" or not listening
    >
    > If you don't use port 16 (you can use any pin you like) you have a
    > problem.
    > The RS232 standard typically uses +/- 12V (some +/-5V) to represent
    > 1 and 0.
    > The Stamp uses 0 and 5V -- not a good match. There are two answers:
    >
    > 1) Use a converter like a MAX232/MAX232A/MAX233 etc. Or, if you have
    > +/- 12V
    > you could use a 1488/1489 combo but for most people the MAX chips
    > are a
    > better fit.
    >
    > 2) Invert the serial output and try to drive the receiver with 0 and
    > 5V. So
    > instead of using 84 in the baudmode, you'd add (I think) $4000 to it
    > (check
    > the manual). The problem is, not all devices will appreciate this.
    > Also, if
    > you want to drive the Stamp from a +/-12V RS232 input, you need a
    > limiting
    > resistor (22K) to keep from blowing the Stamp up.
    >
    > While this method is not very reliable, I've used it many times and
    > it works
    > in nearly all cases.
    >
    > Regards,
    >
    > Al Williams
    > AWC
    > * Floating Point A/D:
    > http://www.al-williams.com/awce/pak9.htm
    >
    >
    > >
    Original Message
    > > From: Tim Carroll [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=5WGtkkRQH2sr_U-fppC9ygTGxPXdTSI9L15WHyqwsZSO9tzDJmnGCSdoM3N6WdKn2lkprbTPiKUm2vN6]ztc0327@y...[/url
    > > Sent: Tuesday, June 12, 2001 9:26 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] PC to stamp2 communication.
    > >
    > >
    > > I'm pretty new to this group and stamps. I have a stamp2 and was
    > > wanting to use it as a interface to my pc. Meaning, I want to
    > create
    > > mini pc controlled robot arm. I am a pretty good C++ and VB
    > > programmer. So last night I wrote a quick program to open an
    > serial
    > > port and send a character to the stamp. When the stamp receives
    > the
    > > character it was to make a sound. Pretty simple, one would think.
    > > It appears that everytime I open the port for communication the
    > stamp
    > > resents. The manual said something like a modification would need
    > to
    > > be made to allow the pc 2 stamp communication to occur, but I
    > didn't
    > > quite understand what change was required. Can someone in the
    > group
    > > HELP????
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed with. 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/
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed with. 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/
    >
    >
Sign In or Register to comment.