Shop OBEX P1 Docs P2 Docs Learn Events
Javelin -BS2 serial communications — Parallax Forums

Javelin -BS2 serial communications

ArchiverArchiver Posts: 46,084
edited 2003-05-29 12:44 in General Discussion
Hello,
I am having trouble interfacing the Javelin Stamp to the Stamp2. I
am able to both send and recieve data to and from both when I am
using the Stamp's I/O pins, but not on the dedicated serial
connecor. I was hoping someone could point out the obvious error
that I am doing.

Here is my original system:

A Javelin Stamp on a breadboard. The stamp has the propor debug
serial connections to one of my PC's. Pin1 is being used to send
serial data and Pin2 is being used to recieve serial data. Using the
UART commands:

this.XMIT=new Uart(Uart.dirTransmit,CPU.pin1, Uart.dontInvert,
Uart.speed2400,Uart.stop1);
this.Rcv = new Uart(Uart.dirReceive, CPU.pin2, Uart.dontInvert,
Uart.speed2400,Uart.stop1);

I also have a Stamp2 on the 'activites' board. With a second PC
hooked into the on-board serial connector. I am also recieving
serial data on pin 15, and Sending serial on pin 14. Using the
commands like:
SERIN 15, 396, [noparse][[/noparse]WAIT ("%"), CC1]
SEROUT 14, 396, [noparse][[/noparse]"%", CC1]

Both boards are on a common power supply. Two wire, with 22K ohm
resistors (in serial) connect each recieve line to their respective
send line.

Using the code i wrote, this systems works great.... But



New setup:

Now I have changed the commands to the following:

Javelin:
this.XMIT=new Uart(Uart.dirTransmit,CPU.pin1, Uart.dontInvert,
Uart.speed9600,Uart.stop2);
this.Rcv = new Uart(Uart.dirReceive, CPU.pin2, Uart.dontInvert,
Uart.speed9600,Uart.stop2);

Stamp2:
SERIN 16, 84, [noparse][[/noparse]WAIT ("%"), CC1]
SEROUT 16, 84, [noparse][[/noparse]"%", CC1]

I have removed the stamp debug cable (after progamming) and inserted
the two serial lines from pins 14 and 15 into pins 2 and 3 (the
propor pins) of the on-board serial connecotr (DB-9). Both lines
still have the 22k Oum resistors.

This system will not work with my code.

I have heared that the stamp will 'echo' characters back. This
should not affect my code. (I recieve garbage on the javelin serial
buffer).

Any ideas on what I should try? I think that the Stamp activities
board ground DTR and GND on the stamp, so those shouldn't be an
issue. I really just need to know what settings I should be using.

please help..

-Jim

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-05-28 17:56
    Hi Jim,

    >>I have removed the stamp debug cable (after progamming) and
    >>inserted the two serial lines from pins 14 and 15 into pins 2 and 3
    >>(the propor pins) of the on-board serial connecotr (DB-9). Both
    >>lines still have the 22k Oum resistors.

    The BASIC Stamp setup wasn't very clear to me. Since you're using the
    Activity Boards DB-9 connector and a Rpin of 16, I'm not sure what
    you are doing by inserting the 2 serial lines from pins 14 and 15
    into pins 2 and 3.

    Ed
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-28 18:36
    Aha! Several things.

    1. Using
    'SEROUT 16, SerBaud, [noparse][[/noparse] Data ] '
    (the DB-9 connector)
    requires an Inverted baud mode, when
    talking to a non-Invert Stamp
    (or Javelin) port.

    2. The BS2 'pin-16' port (tied to the
    DB-9) requires the OTHER port talking
    to it to provide the +- 12 volts for
    232 communication. You might try
    running the Javelin in Invert mode,
    and the BS2 in non-invert, to see
    if that makes a difference.

    3. You MUST have a common signal
    ground between the Javelin and the
    BS2 -- which from reading your post
    you may or may not.

    4. If you DIDN'T use the BS2 '16' port,
    this should work with both chips on
    non-invert, as long as you have put
    in a common ground.

    The conclusion is that by moving to
    'port 16', you added a 232 driver into
    the mix that wasn't there from BS2
    pins 14 and 15, and so you need to
    tell one side to send/receive 'Invert'.

    Even then, this may not work depending
    on the voltage requirements of 'port 16'.


    --- In basicstamps@yahoogroups.com, "capstone32000" <jp@b...> wrote:
    > Hello,
    > I am having trouble interfacing the Javelin Stamp to the Stamp2.
    I
    > am able to both send and recieve data to and from both when I am
    > using the Stamp's I/O pins, but not on the dedicated serial
    > connecor. I was hoping someone could point out the obvious error
    > that I am doing.
    >
    > Here is my original system:
    >
    > A Javelin Stamp on a breadboard. The stamp has the propor debug
    > serial connections to one of my PC's. Pin1 is being used to send
    > serial data and Pin2 is being used to recieve serial data. Using
    the
    > UART commands:
    >
    > this.XMIT=new Uart(Uart.dirTransmit,CPU.pin1,
    Uart.dontInvert,
    > Uart.speed2400,Uart.stop1);
    > this.Rcv = new Uart(Uart.dirReceive, CPU.pin2,
    Uart.dontInvert,
    > Uart.speed2400,Uart.stop1);
    >
    > I also have a Stamp2 on the 'activites' board. With a second PC
    > hooked into the on-board serial connector. I am also recieving
    > serial data on pin 15, and Sending serial on pin 14. Using the
    > commands like:
    > SERIN 15, 396, [noparse][[/noparse]WAIT ("%"), CC1]
    > SEROUT 14, 396, [noparse][[/noparse]"%", CC1]
    >
    > Both boards are on a common power supply. Two wire, with 22K ohm
    > resistors (in serial) connect each recieve line to their respective
    > send line.
    >
    > Using the code i wrote, this systems works great.... But
    >
    >
    >
    > New setup:
    >
    > Now I have changed the commands to the following:
    >
    > Javelin:
    > this.XMIT=new Uart(Uart.dirTransmit,CPU.pin1,
    Uart.dontInvert,
    > Uart.speed9600,Uart.stop2);
    > this.Rcv = new Uart(Uart.dirReceive, CPU.pin2,
    Uart.dontInvert,
    > Uart.speed9600,Uart.stop2);
    >
    > Stamp2:
    > SERIN 16, 84, [noparse][[/noparse]WAIT ("%"), CC1]
    > SEROUT 16, 84, [noparse][[/noparse]"%", CC1]
    >
    > I have removed the stamp debug cable (after progamming) and
    inserted
    > the two serial lines from pins 14 and 15 into pins 2 and 3 (the
    > propor pins) of the on-board serial connecotr (DB-9). Both lines
    > still have the 22k Oum resistors.
    >
    > This system will not work with my code.
    >
    > I have heared that the stamp will 'echo' characters back. This
    > should not affect my code. (I recieve garbage on the javelin
    serial
    > buffer).
    >
    > Any ideas on what I should try? I think that the Stamp activities
    > board ground DTR and GND on the stamp, so those shouldn't be an
    > issue. I really just need to know what settings I should be using.
    >
    > please help..
    >
    > -Jim
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-28 20:27
    Thank you very much for this reply... It is exactly what i was
    looking for. First thing I will try when I get home is to invert the
    Javelin. I was curious about the signal Ground Tie. I have both
    units operating off of the same bench-top power supply, so both
    stamps are at the same ground. Is this adaquate? In otherwords,
    because there is no specified pin for signal gnd, I am assuming that
    if the two chips are operating off of the same ground they do not
    need an extra ground wire. Is this true?

    --- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
    wrote:
    > Aha! Several things.
    >
    > 1. Using
    > 'SEROUT 16, SerBaud, [noparse][[/noparse] Data ] '
    > (the DB-9 connector)
    > requires an Inverted baud mode, when
    > talking to a non-Invert Stamp
    > (or Javelin) port.
    >
    > 2. The BS2 'pin-16' port (tied to the
    > DB-9) requires the OTHER port talking
    > to it to provide the +- 12 volts for
    > 232 communication. You might try
    > running the Javelin in Invert mode,
    > and the BS2 in non-invert, to see
    > if that makes a difference.
    >
    > 3. You MUST have a common signal
    > ground between the Javelin and the
    > BS2 -- which from reading your post
    > you may or may not.
    >
    > 4. If you DIDN'T use the BS2 '16' port,
    > this should work with both chips on
    > non-invert, as long as you have put
    > in a common ground.
    >
    > The conclusion is that by moving to
    > 'port 16', you added a 232 driver into
    > the mix that wasn't there from BS2
    > pins 14 and 15, and so you need to
    > tell one side to send/receive 'Invert'.
    >
    > Even then, this may not work depending
    > on the voltage requirements of 'port 16'.
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-28 20:31
    Thanks for the reply

    With the stamp2 in the activites board, pin2 and pin3 on the DB9 are
    connected directly to SIN and SOUT pins on the stamp. (Pins 1 and 2).

    I was curious if anything special had to be done with pins 3,4 or 5
    on the db9.

    -someone had suggested that it may only be that the javelin needs to
    be operating in 'inverted' mode. I will try this tonight.

    Thanks
    -Jim



    --- In basicstamps@yahoogroups.com, "amulet_ed" <edsandoval@h...>
    wrote:
    > Hi Jim,
    >
    > >>I have removed the stamp debug cable (after progamming) and
    > >>inserted the two serial lines from pins 14 and 15 into pins 2 and
    3
    > >>(the propor pins) of the on-board serial connecotr (DB-9). Both
    > >>lines still have the 22k Oum resistors.
    >
    > The BASIC Stamp setup wasn't very clear to me. Since you're using
    the
    > Activity Boards DB-9 connector and a Rpin of 16, I'm not sure what
    > you are doing by inserting the 2 serial lines from pins 14 and 15
    > into pins 2 and 3.
    >
    > Ed
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-28 22:50
    There are connection schematics in our manuals. For what it's worth, I
    routinely swap BASIC Stamps and a Javelin Stamp in and out of the same activity
    board with no problems.

    -- Jon Williams
    -- Parallax

    In a message dated 5/28/2003 2:35:07 PM Central Standard Time, jp@b...
    writes:

    > Thanks for the reply
    >
    > With the stamp2 in the activites board, pin2 and pin3 on the DB9 are
    > connected directly to SIN and SOUT pins on the stamp. (Pins 1 and 2).
    >
    > I was curious if anything special had to be done with pins 3,4 or 5
    > on the db9.
    >
    > -someone had suggested that it may only be that the javelin needs to
    > be operating in 'inverted' mode. I will try this tonight.
    >
    > Thanks
    > -Jim



    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-29 02:27
    Yes, if they're both using the same bench power supply, then they
    should both be on the same ground. I was not sure if the 'power
    supply' was two wall-warts plugged in to the same AC line -- in which
    case, the 'ground' for each could be different enough to have an
    effect.

    It's easy enough to check with a voltmeter. Put one lead on one
    board's ground, and the other lead on the other ground. You should
    not have any DC voltage (OK, 10 milli-volts is not a problem). Check
    for AC voltage also, again, it should be 0.

    --- In basicstamps@yahoogroups.com, "capstone32000" <jp@b...> wrote:
    > Thank you very much for this reply... It is exactly what i was
    > looking for. First thing I will try when I get home is to invert
    the
    > Javelin. I was curious about the signal Ground Tie. I have both
    > units operating off of the same bench-top power supply, so both
    > stamps are at the same ground. Is this adaquate? In otherwords,
    > because there is no specified pin for signal gnd, I am assuming
    that
    > if the two chips are operating off of the same ground they do not
    > need an extra ground wire. Is this true?
    >
    > --- In basicstamps@yahoogroups.com, "Allan Lane" <allan.lane@h...>
    > wrote:
    > > Aha! Several things.
    > >
    > > 1. Using
    > > 'SEROUT 16, SerBaud, [noparse][[/noparse] Data ] '
    > > (the DB-9 connector)
    > > requires an Inverted baud mode, when
    > > talking to a non-Invert Stamp
    > > (or Javelin) port.
    > >
    > > 2. The BS2 'pin-16' port (tied to the
    > > DB-9) requires the OTHER port talking
    > > to it to provide the +- 12 volts for
    > > 232 communication. You might try
    > > running the Javelin in Invert mode,
    > > and the BS2 in non-invert, to see
    > > if that makes a difference.
    > >
    > > 3. You MUST have a common signal
    > > ground between the Javelin and the
    > > BS2 -- which from reading your post
    > > you may or may not.
    > >
    > > 4. If you DIDN'T use the BS2 '16' port,
    > > this should work with both chips on
    > > non-invert, as long as you have put
    > > in a common ground.
    > >
    > > The conclusion is that by moving to
    > > 'port 16', you added a 232 driver into
    > > the mix that wasn't there from BS2
    > > pins 14 and 15, and so you need to
    > > tell one side to send/receive 'Invert'.
    > >
    > > Even then, this may not work depending
    > > on the voltage requirements of 'port 16'.
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2003-05-29 12:44
    Why not just use a board which allows you to connect a programming cable and
    a serial I/O cable at the same time? Check out:
    http://www.geocities.com/jimforkin2003/


    Original Message
    From: amulet_ed [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=LhIHdvBw8_xizzbLwib_FLsPK4HF2BAyNfF2TWK_KH_zgdx39fylV5slGBbCUR4qkxP3Xdc4QC69wV_MoyA]edsandoval@h...[/url
    Sent: Wednesday, May 28, 2003 12:57 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: Javelin -BS2 serial communications


    Hi Jim,

    >>I have removed the stamp debug cable (after progamming) and
    >>inserted the two serial lines from pins 14 and 15 into pins 2 and 3
    >>(the propor pins) of the on-board serial connecotr (DB-9). Both
    >>lines still have the 22k Oum resistors.

    The BASIC Stamp setup wasn't very clear to me. Since you're using the
    Activity Boards DB-9 connector and a Rpin of 16, I'm not sure what
    you are doing by inserting the 2 serial lines from pins 14 and 15
    into pins 2 and 3.

    Ed


    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/
Sign In or Register to comment.