Shop OBEX P1 Docs P2 Docs Learn Events
RS232 between two BS2 — Parallax Forums

RS232 between two BS2

HanfiHanfi Posts: 2
edited 2007-12-13 05:31 in BASIC Stamp
Hello

So if i want to talk between 2 BasicStamp
with Serin and serout

so i could do it like this

Example:
BS2 number 1:
RXD con 1
Baud con 16624
recchar var byte
TXD con 2
Baud con 16624
pace var 200

loop:
serin RXD, baud, 500, timeout, [noparse][[/noparse]recchar] 'Timeouit=500ms'
goto loop

BS2
TXD con 2
Baud con 16624
pace var 200
RXD con 1
Baud con 16624
recchar var byte
loop:
serout TXD, baud, 500, pace, [noparse][[/noparse]"HELLO",cr]
serin RXD, baud, 500, timeout, [noparse][[/noparse]recchar] 'Timeouit=500ms'
goto loop

pin
1 - 2
2 - 1
vss - vss

okay ? confused.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-13 05:31
    You have the right idea. There are some examples of this in the Parallax Stamp Basic manual and in some of the Nuts and Volts articles.
    I would recommend putting a 220 ohm resistor in each lead (pin 1 BS2 #1 to 1K to pin2 BS2 #2 and pin1 BS2 #2 to 1K to pin2 BS2 #1) to protect from accidental damage to the I/O pin if you make a mistake in programming and try to do a SEROUT on both connected pins at the same time.
Sign In or Register to comment.