Parallax BASIC Stamp 2e Programming Manual page 297

Table of Contents

Advertisement

Figure 5.34: Serial port diagram
showing correct connections to a
BASIC Stamp's I/O pin. NOTE: A
line driver may have to be used
between the I/O pin and the
receiving serial port to ensure
proper communication.
S
ERIAL TIMING AND MODE
(
).
BAUDMODE
5: BASIC Stamp Command Reference – SEROUT
All BASIC Stamps (including the BS1) can also transmit RS-232 data
through any of their I/O pins (Tpin = 0 – 7 for BS1, Tpin = 0 – 15 on all
other BASIC Stamps). The I/O pins only provide a 0 to +5 volt swing
(outside of RS-232 specs) and may need to be connected through a line
driver for proper operation with all serial ports. Most serial ports are able
to recognize a 0 to +5 volt swing, however. See Figure 5.34 for sample
wiring.
from I/O pin
1
2
3
4
6
7
8
DB-9 Male
(Connector Side)
Function
Data Carrier Detect (DCD)
Receive Data (RD)
Transmit Data (TD)
Data Terminal Ready (DTR)
Signal Ground (SG)
Data Set Ready (DSR)
Request to Send (RTS)
Clear to Send (CTS)
Figure 5.34 shows the pinouts of the two styles of PC serial ports and how
to connect them to the BASIC Stamp's I/O pin. Though not normally
needed, the figure also shows loop back connections that defeat hardware
handshaking used by some PC software.
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, SEROUT requires a value called Baudmode that tells
it the important characteristics of the outgoing serial data; the bit period,
number of data and parity bits, and polarity.
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 295
from I/O pin
5
9
Vss
DB9
DB25
1
8
NOTE: The connections shown with double-lines are
2
3
normally not necessary. They indicate optional connections
3
2
to disable hardware handshaking (DTR-DSR-DCD and
4
20
RTS-CTS). This is only necessary if you are using software
5
7
or hardware that expects hardware handshaking.
6
6
7
4
8
5
Vss
1
2
3
4
5
6
7
8
9
10
14
15
16
17
18
19
20
21
22
DB-25 Male
(Connector Side)
Note that PC serial ports are
11
12
13
23
24
25

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents