5: BASIC Stamp Command Reference – SEROUT
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 295
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.
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. 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, 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.
S
ERIAL TIMING AND MODE
(
BAUDMODE
).
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.
DB-9 Male
(Connector Side)
from I/O pin
2
3
4
Transmit Data (TD)
Receive Data (RD)
Request to Send (RTS)
6
7
20
Data Set Ready (DSR)
Signal Ground (SG)
Data Terminal Ready (DTR)
3
2
7
6
5
4
DB25
Function
DB9
NOTE: The connections shown with double-lines are
normally not necessary. They indicate optional connections
to disable hardware handshaking (DTR-DSR-DCD and
RTS-CTS). This is only necessary if you are using software
or hardware that expects hardware handshaking.
DB-25 Male
(Connector Side)
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
9
8
7
6
5
4
3
2
1
Vss
from I/O pin
Vss
8
Data Carrier Detect (DCD)
1
5
Clear to Send (CTS)
8
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...