SEROUT - BASIC Stamp Command Reference
Page 296
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
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.80 indicates the Baudmode value or symbols to use when selecting
the desired mode.
Baudmode
Value
Symbol
Baud Rate
Polarity and
Output Mode
0
T2400
2400
TRUE (always driven)
1
T1200
1200
TRUE (always driven)
2
T600
600
TRUE (always driven)
3
T300
300
TRUE (always driven)
4
N2400
2400
INVERTED (always driven)
5
N1200
1200
INVERTED (always driven)
6
N600
600
INVERTED (always driven)
7
N300
300
INVERTED (always driven)
8
OT2400
2400
TRUE (open drain, driven high)
9
OT1200
1200
TRUE (open drain, driven high)
10
OT600
600
TRUE (open drain, driven high)
11
OT300
300
TRUE (open drain, driven high)
12
ON2400
2400
INVERTED (open source, driven low)
13
ON1200
1200
INVERTED (open source, driven low)
14
ON600
600
INVERTED (open source, driven low)
15
ON300
300
INVERTED (open source, driven low)
On the BS2, BS2e, BS2sx and BS2p, serial communication is very flexible.
The Baudmode argument for SEROUT 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.81
shows how Baudmode is calculated and Tables 5.82, 5.83 and 5.84 show
common baud modes for standard serial baud rates.
Step 1: Determine the
bit period (bits 0 – 11)
BS2 and BS2e: = INT(1,000,000 / baud rate) – 20
BS2sx: = INT(2,500,000 / baud rate) – 20
BS2p: = INT(2,500,000 / baud rate) – 20
Note: INT means 'convert to integer;' drop the numbers to the right of the
decimal point.
Step 2: Set data bits
and parity (bit 13)
8-bit/no-parity = 0
7-bit/even-parity = 8192
Step 3: Select
polarity (bit 14)
True (noninverted) = 0
Inverted = 16384
Step 4: Select driven or
open output (bit 15)
Driven = 0
Open = 32768
Table 5.80: BS1 Baudmode
Values.
Table 5.81: BS2, BS2e, BS2sx and
BS2p Baudmode calculation. Add
the results of steps 1, 2, 3 and 4 to
determine the proper value for the
Baudmode argument.
1
2
e
2
sx
2
p
2
Содержание BASIC Stamp 1
Страница 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...