Shop OBEX P1 Docs P2 Docs Learn Events
serial COM with Matlab — Parallax Forums

serial COM with Matlab

ArchiverArchiver Posts: 46,084
edited 2002-11-27 14:03 in General Discussion
I'm very new to this BS2 stuff.
So far I've gotten programs downloaded and working on the BS2 using
the VB editor it comes with.
I've moving on to the next step of my project, and appear to be
hitting a brick wall. help please!
Basically I want my computer to give control signals to the stamp in
real-time.

1. I have a basic stamp connected to my PC through the serial cable.
2. I download VB code using the stamp's editor. This code just
waits for serial input through the serin pin and lights up an LED
when it receives certain text.
3. I exit the BS2 editor to free the serial port
4. I use matlab to create a serial port object and try to open the
connection to the port the BS2 is connected.

This opening fails.

I really don't want to actually physically solder and wire anything
through specific pins on the stamp, I just want to use the serial
cable that is used to download programs to the stamp.
I've tried doing this in C++, but that didn't work either. I figured
first trying it in matlab would be easier.

Please help.

-Nigel

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-27 09:07
    Hi Nigel

    I think your setup and cable is ok as it is and there will be no need
    for soldering - not a lot at least.
    could you be more specific about "this opening fails"?
    If i understand you right, you are using the program pins RX/TX (both
    referred as nr 16) - this is ok, i am doing this too. Note that these
    pins have a special property you have to take in mind when doing your
    own communication: they have a loopback echo. This means that each
    byte you send to RX is reflected back to the sender through TX.
    Also the speed is fixed to 9600 bps (8 bit, no parity).

    Regards
    Adrian
  • ArchiverArchiver Posts: 46,084
    edited 2002-11-27 14:03
    Nigel-

    First thing I'd check: have you disabled DTR in your MATLAB and/or
    C++ program? If active, this asserts ATN on your Stamp and holds it
    in perpetual reset (not a good thing).

    Regards,

    Steve

    On 27 Nov 02 at 6:48, Nigel wrote:

    > I'm very new to this BS2 stuff.
    > So far I've gotten programs downloaded and working on the BS2 using
    > the VB editor it comes with. I've moving on to the next step of my
    > project, and appear to be hitting a brick wall. help please!
    > Basically I want my computer to give control signals to the stamp in
    > real-time.
    >
    > 1. I have a basic stamp connected to my PC through the serial cable.
    > 2. I download VB code using the stamp's editor. This code just
    > waits for serial input through the serin pin and lights up an LED
    > when it receives certain text. 3. I exit the BS2 editor to free the
    > serial port 4. I use matlab to create a serial port object and try
    > to open the connection to the port the BS2 is connected.
    >
    > This opening fails.
    >
Sign In or Register to comment.