Serial Communication With BS2
Archiver
Posts: 46,084
You do not have to use the SERIN and SEROUT ports for serial
communication. You can use a standard pin (0-15 if you have BS2) and
use the command:
serout P, 16780, [noparse][[/noparse]D]
Where P = pin number and D = data (do not leave out brackets)
16780 is the baud mode, but that can be left the same (9400 inverted
I think). I am not sure, but, I believe that the SEROUT and SERIN
pins can be controlled using the same code exept that they are like
pins 16 and 17 or something. But, I do know that you can use regular
pins for serial communication. To recieve serial info use:
serin P, 16780, V
Where P = pin number and V = variable to save data to.
Hope this figures things out for you. As far as connection to a
serial cable:
__________
\ 12345 /
\_6789_/
Pin 1 = Connected to 4 and 6
2 = Serial Out (leaving BS2)
3 = Serial In (going to BS2)
4 = Connected to 1 and 6
5 = Ground
6 = Connected to 4 and 1
7 = Connected to 8
8 = Connected to 7
9 = Nothing
If this does not work email me.
Talk to you later.
Hey maybe you can help my problem. I am having problems having the
software detect my BS2. I have Pin 1-4 on the BS2 connected
accordingly to pins 2-5 on the serial cable (according to my serial
cable drawing above) then I also have pins 6 and 7 connected
together. Is this the correct hook up?
--Jacob Rossi
--- In basicstamps@y..., "jamesryfler" <jamesryfler@y...> wrote:
> Thanks for all your help regarding the programming languages.
>
>
> I guess I should have expressed myself better.......
> I know its possible to talk to the bs2 chip from the Pc. My query
> relates to the actual boards provided by parallax.
> What I meant was , is it possible to serially communicate with the
> basic stamp 2-sx chip inserted into the standard parallax basic
stamp
> 2 carrier board from the PC ? The parallax docs(specifically the
> basic stamp 2.0 manual -- please see the entry for serin and
serout)
> say that serin and serout can only be used for programming and not
> runtime communication with the basic stamp 2 carrier board(unlike
> other boards eg the super carrier board which permits both).
>
> Has anyone here serially communicated data to the basic stamp 2 on
> the **bs2-carrier board** from a program on the PC?
>
> I just need someone to reassure me on this. Its for my thesis.
> Greatly appreciate any help,
>
> Thanks,
>
> Jim
communication. You can use a standard pin (0-15 if you have BS2) and
use the command:
serout P, 16780, [noparse][[/noparse]D]
Where P = pin number and D = data (do not leave out brackets)
16780 is the baud mode, but that can be left the same (9400 inverted
I think). I am not sure, but, I believe that the SEROUT and SERIN
pins can be controlled using the same code exept that they are like
pins 16 and 17 or something. But, I do know that you can use regular
pins for serial communication. To recieve serial info use:
serin P, 16780, V
Where P = pin number and V = variable to save data to.
Hope this figures things out for you. As far as connection to a
serial cable:
__________
\ 12345 /
\_6789_/
Pin 1 = Connected to 4 and 6
2 = Serial Out (leaving BS2)
3 = Serial In (going to BS2)
4 = Connected to 1 and 6
5 = Ground
6 = Connected to 4 and 1
7 = Connected to 8
8 = Connected to 7
9 = Nothing
If this does not work email me.
Talk to you later.
Hey maybe you can help my problem. I am having problems having the
software detect my BS2. I have Pin 1-4 on the BS2 connected
accordingly to pins 2-5 on the serial cable (according to my serial
cable drawing above) then I also have pins 6 and 7 connected
together. Is this the correct hook up?
--Jacob Rossi
--- In basicstamps@y..., "jamesryfler" <jamesryfler@y...> wrote:
> Thanks for all your help regarding the programming languages.
>
>
> I guess I should have expressed myself better.......
> I know its possible to talk to the bs2 chip from the Pc. My query
> relates to the actual boards provided by parallax.
> What I meant was , is it possible to serially communicate with the
> basic stamp 2-sx chip inserted into the standard parallax basic
stamp
> 2 carrier board from the PC ? The parallax docs(specifically the
> basic stamp 2.0 manual -- please see the entry for serin and
serout)
> say that serin and serout can only be used for programming and not
> runtime communication with the basic stamp 2 carrier board(unlike
> other boards eg the super carrier board which permits both).
>
> Has anyone here serially communicated data to the basic stamp 2 on
> the **bs2-carrier board** from a program on the PC?
>
> I just need someone to reassure me on this. Its for my thesis.
> Greatly appreciate any help,
>
> Thanks,
>
> Jim
Comments
you are talking about SIN and SOUT which are the names of the
dedicated serial ports for programming the Basic Stamp. Also, I
would refrain from calling the serial ports pins. It can be quite
confusing for someone that is new to the game. The serial ports are
named P0-P15 and there is one dedicated output port (SOUT) and one
dedicated input port (SIN). The pin numbers are 5-20, 1 and 2,
respectively. When using the commands SERIN and SEROUT, these two
dedicated ports are specified as port 16.
Now, as far as your question...
I do not understand your drawing below. So, I will try and lay it out
for you.
PIN # PIN #
BS2 DB9
--- ---
1
2
2
3
3
4
4
5
And, PIN #6 and 7 are connected together on the DB9 connector. If
these are the connections you have then I would make sure you have
the latest version of the editor. I had a problem with connecting to
my Basic Stamp as well and downloading the new version fixed the
problem.
-Dustin
--- In basicstamps@y..., "computerman20" <coolnetdude@c...> wrote:
> You do not have to use the SERIN and SEROUT ports for serial
> communication. You can use a standard pin (0-15 if you have BS2)
and
> use the command:
>
> serout P, 16780, [noparse][[/noparse]D]
>
> Where P = pin number and D = data (do not leave out brackets)
> 16780 is the baud mode, but that can be left the same (9400
inverted
> I think). I am not sure, but, I believe that the SEROUT and SERIN
> pins can be controlled using the same code exept that they are like
> pins 16 and 17 or something. But, I do know that you can use
regular
> pins for serial communication. To recieve serial info use:
>
> serin P, 16780, V
>
> Where P = pin number and V = variable to save data to.
>
> Hope this figures things out for you. As far as connection to a
> serial cable:
>
> __________
> \ 12345 /
> \_6789_/
>
> Pin 1 = Connected to 4 and 6
> 2 = Serial Out (leaving BS2)
> 3 = Serial In (going to BS2)
> 4 = Connected to 1 and 6
> 5 = Ground
> 6 = Connected to 4 and 1
> 7 = Connected to 8
> 8 = Connected to 7
> 9 = Nothing
>
> If this does not work email me.
>
> Talk to you later.
>
> Hey maybe you can help my problem. I am having problems having the
> software detect my BS2. I have Pin 1-4 on the BS2 connected
> accordingly to pins 2-5 on the serial cable (according to my serial
> cable drawing above) then I also have pins 6 and 7 connected
> together. Is this the correct hook up?
>
> --Jacob Rossi
>
> --- In basicstamps@y..., "jamesryfler" <jamesryfler@y...> wrote:
> > Thanks for all your help regarding the programming languages.
> >
> >
> > I guess I should have expressed myself better.......
> > I know its possible to talk to the bs2 chip from the Pc. My query
> > relates to the actual boards provided by parallax.
> > What I meant was , is it possible to serially communicate with
the
> > basic stamp 2-sx chip inserted into the standard parallax basic
> stamp
> > 2 carrier board from the PC ? The parallax docs(specifically the
> > basic stamp 2.0 manual -- please see the entry for serin and
> serout)
> > say that serin and serout can only be used for programming and
not
> > runtime communication with the basic stamp 2 carrier board(unlike
> > other boards eg the super carrier board which permits both).
> >
> > Has anyone here serially communicated data to the basic stamp 2
on
> > the **bs2-carrier board** from a program on the PC?
> >
> > I just need someone to reassure me on this. Its for my thesis.
> > Greatly appreciate any help,
> >
> > Thanks,
> >
> > Jim