5: BASIC Stamp Command Reference – OWIN
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 197
OWIN
BS1 BS2 BS2e BS2sx
BS2p
OWIN
Pin, Mode, [InputData]
Function
Receive data from a device using the 1-wire protocol.
•
Pin
is a variable/constant/expression (0 – 15) that specifies which
I/O pin to use. 1-wire devices require only one I/O pin (called DQ)
to communicate. This I/O pin will be toggled between output and
input mode during the OWIN command and will be set to input
mode by the end of the OWIN command.
•
Mode
is a variable/constant/expression (0 – 15) indicating the mode
of data transfer. The Mode argument controls placement of reset
pulses (and detection of presence pulses) as well as byte vs. bit input
and normal vs. high speed. See explanation below.
•
InputData
is a list of variables and modifiers that tells OWIN what to
do with incoming data. OWIN can store data in a variable or array,
interpret numeric text (decimal, binary, or hex) and store the
corresponding value in a variable, wait for a fixed or variable
sequence of bytes, or ignore a specified number of bytes. These
actions can be combined in any order in the InputData list.
Quick Facts
BS2p
Receive Rate
Approximately 20 kbits/sec (low speed, not including reset pulse)
Special notes
The DQ pin (specified by Pin) must have a 4.7 K
Ω
pull-up resister.
Explanation
The 1-wire protocol is a form of asynchronous serial communication
developed by Dallas Semiconductor. It only requires one I/O pin and that
pin can be shared between multiple 1-wire devices. The OWIN command
allows the BASIC Stamp to receive data from a 1-wire device.
The following is an example of the OWIN command:
Result VAR BYTE
OWIN 0, 1, [Result]
This code will transmit a "reset" pulse to a 1-wire device (connected to I/O
pin 0) and then will detect the device's "presence" pulse and then receive
one byte and store it in the variable Result.
Table 5.43: OWIN Quick Facts.
p
2
A
SIMPLE
OWIN
EXAMPLE
.
Содержание 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...