Bs2 to PC connection
Luis_P
Posts: 246
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.
Gracias por su ayuda.
Comments
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.
I will have to research more.
I use the usb cable to program the BS2 no parallel port.
Bs2
DB9 male (PC)
P1______to_____pin2
VSS_____to_____pin5
Commands:
Serout 1, 16780, [65] 'will transmit a byte equal to 65 (leter "A")
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.
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!