5: BASIC Stamp Command Reference – SERIN
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 275
RS-232 is the electrical specification for the signals that PC serial ports use.
Unlike normal logic, where a 5 volts is a logic 1 and 0 volts is logic 0, RS-
232 uses -12 volts for logic 1 and +12 volts for logic 0. This specification
allows communication over longer wire lengths without amplification.
Most circuits that work with RS-232 use a line driver/receiver. This
component does two things: (1) it converts the ±12 volts of RS-232 to
TTL-compatible 0 to 5-volt levels and (2) it inverts the relationship of the
voltage levels, so that 5 volts = logic 1 and 0 volts = logic 0.
All BASIC Stamps (except the BS1) have a line receiver on its SIN pin (Rpin
= 16). See the "Hardware" section of the "Introduction to the BASIC
Stamps" chapter. The SIN pin goes to a PC’s serial data-out pin on the DB9
connector built into BASIC Stamp development boards. The connector is
wired to allow both programming and run-time serial communication
(unless you are using the Stamp 2 Carrier Board which is only designed
for programming).
For the built-in serial port set the Rpin argument to 16
in the SERIN command.
All BASIC Stamps (including the BS1) can also receive RS-232 data
through any of their I/O pins (Rpin = 0 – 7 for BS1, Rpin = 0 – 15 on all
other BASIC Stamps). The I/O pins don’t need a line receiver, just a 22 k
Ω
resistor. The resistor limits current into the I/O pins’ built-in clamping
diodes, which keep input voltages within a safe range. See Figure 5.32
2
e
2
sx
2
p
2
DB-9 Male
(Connector Side)
to I/O pin
22 k
Ω
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
to I/O pin
22 k
Ω
Vss
8
Data Carrier Detect (DCD)
1
5
Clear to Send (CTS)
8
Figure 5.32: Serial Port Diagram
Showing Correct Connections to a
BASIC Stamp's I/O pin. NOTE:
The 22 k
Ω
resister is not required if
connecting to the SIN pin.
U
SING THE BUILT
-
IN SERIAL PORT ON
THE
BS2, BS2
E
, BS2
SX AND
BS2
P
.
Содержание 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...