Hardware Reference
In-Depth Information
specii cations, so care must be taken when choosing devices, as there is a lot of
confusion concerning addressing.
Address
The original I 2 C protocol specii ed 7-bit addressing and was later extended to
allow 10-bit addressing. Some vendors talk about 8-bit addressing, but techni-
cally, this does not exist. Here's why.
I 2 C can send and receive data only in multiples of 8 bits—8 bits, 16 bits, and
so on. In 7-bit addressing, addresses are (of course) 7 bits long, and the last bit is
used to select a read or a write, for a total of 8 bits. In 10-bit addressing, things
are a little more complicated. There is still the R/W bit, but the i rst 5 bits are
sent as 11110, an address that is reser ved i n 7-bit addressi ng and is used only
to tell the system that another byte will follow with the address complement.
Figure 8-3 shows both 7-bit and 10-bit addressing.
7 bits
A6
A5
A4
A3
A2
A1
A0
R/W
11110 9 8 /W
A7
A6
A5
A4
A3
A2
A1
A0
10 bits
Figure 8-3: 7-bit and 10-bit addressing methods
Some vendors give 8-bit addresses for devices, but again, technically, they
do not exist. Vendors will give two values for 8-bit devices, both a read and a
write address. The i rst 7 bits will be the same, but the last bit will be 1 for a read
operation or 0 for a write operation. An example of this is shown in Figure 8-4.
Write Address: 0×90
Read Address: 0×91
100
1
0
00
100
1
0
0
01
100
1
0
0
0
Figure 8-4: 8-bit addresses
When the master contacts a slave on the I 2 C network, it sends two vital pieces
of information; the address of the slave, and whether it is a read or write opera-
tion. When this information is received by the slaves, each slave compares the
address to its own. If a device has this address, it will send an acknowledge
signal (referred to as ACK), indicating that it is present on the network and that
the master can now issue instructions.
 
Search WWH ::




Custom Search