Shop OBEX P1 Docs P2 Docs Learn Events
Newbie - Serial Comm. — Parallax Forums

Newbie - Serial Comm.

ArchiverArchiver Posts: 46,084
edited 2002-04-26 21:27 in General Discussion
Hello,

I have just started some work with a BS2 and I'm encountering a problem that
I am hoping someone might help me resolve.

I'm trying to control a projection system with the BS2 through a serial
connection. The format in which the commands must be sent to the projector
is correct, verified by a Panasonic Technician. My SEROUT command is shown
below:

SEROUT 9, 16468, 1000, [noparse][[/noparse]2,"AD01:PON",3]

However, I'm still unable to get a response from the projector. When I plug
the connector into a laptop and run HyperTerminal everything shows up as
expected.

I've been told that the projector requires a 12/-12 V signal, but someone
else told me that the 0-5V signal from the Stamp should be enough.

Any suggestions would be appreciated

Thanks

Daniel Iaboni
Engineering Co-op
Fakespace Systems






[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-04-26 14:49
    Hi Daniel,

    Well, RS232 interfacing is sometimes a black art.

    A few things to think about:

    1) Make sure you are using the right baud rate for the type of Stamp you
    are using (they are not all the same). Since you say Hypterterminal is
    OK, then I presume this is not your problem.

    2) The projector is probably made to plug into a PC. PCs are DTE (Data
    Terminal Equipment). That means (I'm guessing) the projector is DCE. If
    you can plug a straight cable from your PC to the Stamp, you are wired
    DCE also. If you want a DCE device to talk to another DCE device, you
    need a null modem or cross cable. In your case, it sounds like you are
    only sending data to the projector, so you can probably just reverse
    your transmit pin from 2 to 3 or vice versa. Keep in mind that 25 pin
    and 9 pin are "backwards". On a 25 pin DTE, pin 3 is RX. On a 9 pin DTE,
    pin 2 is RX. So to hook your PC to the projector, I'm guessing you are
    connecting pin 3 (DB9TX) to pin 3 (assuming the projector uses 9 pins)
    or to pin 2 if it uses a DB25. The Stamp output must also connect to the
    same pin.

    3) The 5V signal is not within RS232 spec, but yes, it often works. The
    key here is often (but not always). A MAX232 (for example, our RS1 board
    at http://www.al-williams.com/awce/rs1.htm) will handle the conversion
    for you simply and easily.

    4) Your output in hex is 02 41 44 30 31 3E 50 4F 4E 03 (I think a colon
    is 3E; I'm sure about the rest of them, but this is from memory -- man,
    that's pitiful to read ASCII on sight). So my point is that the first
    and last bytes are 02 and 03 (Control+B and Control+C). Is that what you
    intend? Or did you mean to send ASCII 2 and 3? Does the projector
    require a carriage return or anything like that?

    So in summary, make sure the string is really what you intend. Be sure
    you are driving the correct pin on the projector. And if all else fails,
    suspect the voltage levels.

    Hope that helps.

    Al Williams
    AWC
    * Easy RS-232 Prototyping
    http://www.al-williams.com/awce/rs1.htm

    >
    Original Message
    > From: Daniel Iaboni [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=EocQNXRBvuMEpCqOn2SankdTi5Br6-NTFu3fFyKT_j7BvQDvbGsTTKeSQD3cJtEkegg7qwLDEKcGq2dgsUWlJ1qr1A]diaboni@f...[/url
    > Sent: Friday, April 26, 2002 8:31 AM
    > To: 'basicstamps@yahoogroups.com'
    > Subject: [noparse][[/noparse]basicstamps] Newbie - Serial Comm.
    > Sensitivity: Private
    >
    >
    >
    > Hello,
    >
    > I have just started some work with a BS2 and I'm encountering
    > a problem that I am hoping someone might help me resolve.
    >
    > I'm trying to control a projection system with the BS2
    > through a serial connection. The format in which the commands
    > must be sent to the projector is correct, verified by a
    > Panasonic Technician. My SEROUT command is shown
    > below:
    >
    > SEROUT 9, 16468, 1000, [noparse][[/noparse]2,"AD01:PON",3]
    >
    > However, I'm still unable to get a response from the
    > projector. When I plug the connector into a laptop and run
    > HyperTerminal everything shows up as expected.
    >
    > I've been told that the projector requires a 12/-12 V signal,
    > but someone else told me that the 0-5V signal from the Stamp
    > should be enough.
    >
    > Any suggestions would be appreciated
    >
    > Thanks
    >
    >
    > Daniel Iaboni
    > Engineering Co-op
    > Fakespace Systems
    >
    >
    >
    >
    >
    >
    > [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/
  • ArchiverArchiver Posts: 46,084
    edited 2002-04-26 21:27
    Here's a simple question,


    Is there a way to take a program written in pbasic and change it to the
    code required to work in a PIC that doesn't have pbasic in it?

    thanks,

    Leroy
Sign In or Register to comment.