5: BASIC Stamp Command Reference – OWOUT
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 205
OWOUT
BS1 BS2 BS2e BS2sx
BS2p
OWOUT
Pin, Mode, [OutputData]
Function
Send data to 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 OWOUT command and will be set to input
mode by the end of the OWOUT 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.
•
OutputData
is a list of variables and modifiers that tells OWOUT
how to format outgoing data. OWOUT can transmit individual or
repeating bytes, convert values into decimal, hexadecimal or binary
text representations, or transmit strings of bytes from variable
arrays. These actions can be combined in any order in the
OutputData list.
Quick Facts
BS2p
Transmission
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 OWOUT
command allows the BASIC Stamp to send data to a 1-wire device.
The following is an example of the OWOUT command:
OWOUT 0, 1, [$4E]
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 transmit
one byte (the value $4E).
Table 5.48: OWOUT Quick Facts.
p
2
A
SIMPLE
OWOUT
EXAMPLE
.
Summary of Contents for BASIC Stamp 1
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...