Shop OBEX P1 Docs P2 Docs Learn Events
Serial protocol of BS2 — Parallax Forums

Serial protocol of BS2

ArchiverArchiver Posts: 46,084
edited 2002-10-28 17:33 in General Discussion
Hello,
I'm attempting to use a BS2 to control a video switcher (Panasonic
WJ-SC150) via the serial port.
The device lists the com settings as 9600 baud, 8 bit data length,
no parity, and 1 stop bit. These are the same settings as the debug
command, right?

The commands are supposed to be sent in the following format:

[noparse][[/noparse]STX] CMD:R01ZM [noparse][[/noparse]ETX]

Would this translate into

debug 2,"CMD:R01ZM",3

because the asci STX and ETX are represented by 02H and 03H? This
does not produce the expected effect, so I am assuming that I am not
sending the commands right. Does the debug automatically add the STX
and the ETX for me?

ps. Sorry about the previous blank post. The yahoo groups web
interface 'preview' option appears to have cleared out the text.
Thanks,
Paul Jordan

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-10-28 17:33
    Hi Paul,

    Lets see if I can provide any useful information here. The debug
    command will only display information on the PC screen within the
    BASIC stamp editor program. If you really want to send "[noparse][[/noparse]STX] CMD:
    R01ZM [noparse][[/noparse]ETX]" out the serial port at 9600 baud, 8 bit data length, no
    parity and 1 stop bit, then I would use the serout command. The
    serout command will transmit asynchronous serial data, also known as
    RS-232 data, over the serial port. This is the command I would use to
    send your command out the serial port:

    serout 16, 84, [noparse][[/noparse]$02,"CMD:R01ZM",$03]

    serout = transmit asynchrounous serial data
    16 = instruct BASIC Stamp to use dedicated serial-output pin
    84 = 9600 baud, 8-bit data, no-parity, true polarity
    [noparse][[/noparse]$02,"CMD:R01ZM",$03] = storage array for outgoing serial data

    I'm assuming the following:
    [noparse][[/noparse]STX] = 02H
    [noparse][[/noparse]ETX] = 03H

    Hope this helps. Good luck.

    Ed



    --- In basicstamps@y..., "jordanautomations" <jordanautomations@y...>
    wrote:
    > Hello,
    > I'm attempting to use a BS2 to control a video switcher (Panasonic
    > WJ-SC150) via the serial port.
    > The device lists the com settings as 9600 baud, 8 bit data length,
    > no parity, and 1 stop bit. These are the same settings as the debug
    > command, right?
    >
    > The commands are supposed to be sent in the following format:
    >
    > [noparse][[/noparse]STX] CMD:R01ZM [noparse][[/noparse]ETX]
    >
    > Would this translate into
    >
    > debug 2,"CMD:R01ZM",3
    >
    > because the asci STX and ETX are represented by 02H and 03H? This
    > does not produce the expected effect, so I am assuming that I am
    not
    > sending the commands right. Does the debug automatically add the
    STX
    > and the ETX for me?
    >
    > ps. Sorry about the previous blank post. The yahoo groups web
    > interface 'preview' option appears to have cleared out the text.
    > Thanks,
    > Paul Jordan
Sign In or Register to comment.