Shop OBEX P1 Docs P2 Docs Learn Events
Bs2 to PC connection — Parallax Forums

Bs2 to PC connection

Luis_PLuis_P Posts: 246
edited 2010-10-15 15:54 in BASIC Stamp
I see many tutorials on how to send data from PC (visual Basic) to BS2. what I don't see is the wiring connection. I assume pin 0 on the Bs2 to send out data and what pin should I use on the parallel port (9 pins) of PC?.

Gracias por su ayuda.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-10-14 16:05
    You can use the same cable you use to program the stamp. It is after all a serial cable.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-14 16:19
    This is described in the Stamp Basic Syntax and Reference Manual and in the corresponding portion of the Stamp Editor's help files under the SEROUT and SERIN statements.
  • $WMc%$WMc% Posts: 1,884
    edited 2010-10-14 17:13
    Luis_P wrote: »
    I see many tutorials on how to send data from PC (visual Basic) to BS2. what I don't see is the wiring connection. I assume pin 0 on the BS2 to send out data and what pin should I use on the parallel port (9 pins) of PC?.

    Gracias por su ayuda.
    '
    You Can also look into the "DEBUG" command. This is how Parallax handles read/write serial with the BS2. Once you understand this,VB will be allot easier.
    '
    One other thing to add. I have found "JustBasic" a little easier to use over VB. JustBasic is a free Basic Compiler for windows, And it already has a Serial COM program in the Demos folder to help you get started with your project.
  • Luis_PLuis_P Posts: 246
    edited 2010-10-15 08:37
    I knew I will not get an easy answer like " connect to pin #".
    I will have to research more.
    I use the usb cable to program the BS2 no parallel port.
  • Luis_PLuis_P Posts: 246
    edited 2010-10-15 09:05
    Connections to send data to PC:

    Bs2
    DB9 male (PC)
    P1______to_____pin2
    VSS_____to_____pin5

    Commands:
    Serout 1, 16780, [65] 'will transmit a byte equal to 65 (leter "A")
    bmp
    400K
    DB9.bmp 399.6K
  • Mike GreenMike Green Posts: 23,101
    edited 2010-10-15 09:15
    1) The Stamp Manual I mentioned has a perfectly good picture of how to connect a DB9 serial connector to a Stamp.

    2) The syntax you showed for the SEROUT statement is for the BS1 and won't work for the BS2. Check the Manual or the help files for the correct syntax.
  • Luis_PLuis_P Posts: 246
    edited 2010-10-15 10:12
    Thanks Mike, I already correct my mistake. But the connection picture I posted is correct for both Bs2 and Bs1
  • $WMc%$WMc% Posts: 1,884
    edited 2010-10-15 15:54
    Luis_P wrote: »
    I knew I will not get an easy answer like " connect to pin #".
    I will have to research more.
    I use the usb cable to program the BS2 no parallel port.
    '
    USB is a com port too.I use it all the time with my laptop,Since it doesn't have a DB9 serial port, Only USB.
    '
    Look under the Directives tab in the Basic Stamp Editor, Place the cursor over PORTS and it will show you the COM ports available to the Editor.
    " USB will NOT be COM1"
    '
    This will be the COM port number that you'll need to plug into your VB code to open the right COM port on your PC.
    '
    If you'll look into DEBUG statements this is always the programing pins, So you don't have to assign any PIN CONs for the BS2 to PC.
    Instead of opening a DEBUG terminal, You use your VB app.
    '
    If you insist on using different PINs you'll need to add a MAX232 or FTDI or eq. chip to Handel the USB. Wasting the hardware you already have.
    '
    Hang-in there, Do a little reading and You'll see what I'm talking about.
    '
    Its beyond the forum for me to show you all the Doc's of the BS2, You just need to go and look them up.
    '
    How do you eat an Elephant?---- One Byte at a time!
Sign In or Register to comment.