5: BASIC Stamp Command Reference – I2CIN
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 137
I2CIN
BS1 BS2 BS2e BS2sx
BS2p
I2CIN
Pin, SlaveID, Address {\LowAddress}, [InputData]
Function
Receive data from a device using the I
2
C protocol.
•
Pin
is a variable/constant/expression (0 or 8) that specifies which
I/O pins to use. I
2
C devices require two I/O pins to communicate.
The Pin argument serves a double purpose; specifying the first pin
(for connection to the chip's SDA pin) and, indirectly, the other
required pin (for connection to the chip's SCL pin). See explanation
below. Both I/O pins will be toggled between output and input
mode during the I2CIN command and both will be set to input
mode by the end of the I2CIN command.
•
SlaveID
is a variable/constant/expression (0 – 255) indicating the
unique ID of the I
2
C chip.
•
Address
is a variable/constant/expression (0 – 255) indicating the
desired address within the I
2
C chip to receive data from. The
Address argument may be used with the optional LowAddress
argument to indicate a word-sized address value.
•
LowAddress
is a variable/constant/expression (0 – 255) indicating
the low-byte of the word-sized address within the I
2
C chip to receive
data from. This argument must be used along with the Address
argument.
•
InputData
is a list of variables and modifiers that tells I2CIN what to
do with incoming data. I2CIN 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
Values for Pin
0 or 8
I/O pin
arrangement
When Pin is 0: When Pin is 8:
0: Serial Data (SDA) pin 8: Serial Data (SDA) pin
1: Serial Clock (SCL) pin 9: Serial Clock (SCL) pin
Transmission
Rate
Approximately 81 kbits/sec (not including overhead).
Special notes
Both the SDA and SCL pins must have 4.7 K
Ω
pull-up resisters.
The I2CIN command does not allow for multiple masters.
The BASIC Stamp cannot operate as an I
2
C slave device.
Table 5.16: I2CIN Quick Facts.
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...