Datasheet
MCP23017/MCP23S17
DS21952B-page 8 © 2007 Microchip Technology Inc.
1.4 Hardware Address Decoder
The hardware address pins are used to determine the
device address. To address a device, the correspond-
ing address bits in the control byte must match the pin
state. The pins must be biased externally.
1.4.1 ADDRESSING I
2
C DEVICES
(MCP23017)
The MCP23017 is a slave I
2
C interface device that
supports 7-bit slave addressing, with the read/write bit
filling out the control byte. The slave address contains
four fixed bits and three user-defined hardware
address bits (pins A2, A1 and A0). Figure 1-2 shows
the control byte format.
1.4.2 ADDRESSING SPI DEVICES
(MCP23S17)
The MCP23S17 is a slave SPI device. The slave
address contains four fixed bits and three user-defined
hardware address bits (if enabled via IOCON.HAEN)
(pins A2, A1 and A0) with the read/write bit filling out
the control byte. Figure 1-3 shows the control byte
format. The address pins should be externally biased
even if disabled (IOCON.HAEN = 0).
FIGURE 1-2: I
2
C™ CONTROL BYTE
FORMAT
FIGURE 1-3: SPI CONTROL BYTE
FORMAT
FIGURE 1-4: I
2
C™ ADDRESSING REGISTERS
FIGURE 1-5: SPI ADDRESSING REGISTERS
S 0 1 0 0 A2A1A0R/WACK
Start
bit
Slave Address
R/W bit
ACK bit
Control Byte
R/W = 0 = write
R/W = 1 = read
0 1 0 0 A2 A1 A0 R/W
Slave Address
R/W bit
Control Byte
R/W = 0 = write
R/W = 1 = read
CS
S0100A2A1A00ACK* A7 A6 A5 A4 A3 A2 A1 A0 ACK*
Device Opcode
Register Address
R/W = 0
*The ACKs are provided by the MCP23017.
0100A2
*
A1
*
A0
*
R/WA7A6A5A4A3A2A1A0
Device Opcode
Register Address
CS
* Address pins are enabled/disabled via IOCON.HAEN.