EasyManua.ls Logo

Parallax BASIC Stamp 2e - Page 278

Default Icon
353 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SERIN - BASIC Stamp Command Reference
Page 276 BASIC Stamp Programming Manual 2.0b www.parallaxinc.com
Figure 5.32 shows the pinouts of the two styles of PC serial ports and how
to connect them to the BASIC Stamp's I/O pin (the 22K resister is not
needed if connecting to the SIN pin). Though not normally needed, the
figure also shows loop back connections that defeat hardware
handshaking used by some PC software. Note that PC serial ports are
always male connectors. The 25-pin style of serial port (called a DB25)
looks similar to a printer (parallel) port except that it is male, whereas a
parallel port is female.
Asynchronous serial communication relies on precise timing. Both the
sender and receiver must be set for identical timing, usually expressed in
bits per second (bps) called baud.
On all BASIC Stamps, SERIN requires a value called Baudmode that tells it
the important characteristics of the incoming serial data; the bit period,
number of data and parity bits, and polarity.
On the BS1, serial communication is limited to: no-parity, 8-data bits and
1-stop bit at one of four different speeds: 300, 600, 1200 or 2400 baud.
Table 5.71 indicates the Baudmode value or symbols to use when selecting
the desired mode.
Baudmode
Value
Symbol Baud Rate Polarity
0 T2400 2400 TRUE
1 T1200 1200 TRUE
2 T600 600 TRUE
3 T300 300 TRUE
4 N2400 2400 INVERTED
5 N1200 1200 INVERTED
6 N600 600 INVERTED
7 N300 300 INVERTED
On the BS2, BS2e, BS2sx and BS2p, serial communication is very flexible.
The Baudmode argument for SERIN accepts a 16-bit value that determines
its characteristics: 1-stop bit, 8-data bits/no-parity or 7-data
bits/even-parity and virtually any speed from as low as 300 baud to
greater than 100K baud (depending on the BASIC Stamp). Table 5.72
SERIAL TIMING AND MODE
(BAUDMODE).
Table 5.71: BS1 Baudmode values.
1
2
e
2
sx
2
p
2

Table of Contents

Related product manuals