English
Language : 

AN1043 Datasheet, PDF (2/10 Pages) Microchip Technology – Unique Features of the MCP23X08/17 GPIO Expanders
AN1043
FIGURE 1:
I/O PORT BLOCK DIAGRAM
VDD
Data Bus
Write
Write
Read
Port
D SET Q
Q CLR
OLAT or
GPIO
D SET Q
Q CLR
IODIR
MCP23X08/17
I/O
Pad
Input
Buffer
Q SET D
Q CLR
8/16 BIT MODE (MCP23X17 ONLY)
The MCP23X17 has the unique ability to appear to the
MCU as either two (2) 8-bit GPIO expanders, or as a
single 16-bit GPIO expander.
This is accomplished by splitting the 16 I/O ports into
two separate 8-bit I/O ports (Port A and Port B) via
IOCON.bank.
Each port has a group of dedicated registers. Table 1
shows how the register groups (Port A and Port B) are
mapped when in 8-bit or 16-bit mode.
Note:
Unlike all other registers which are not
shared between the two ports (Port A and
Port B), there is one register (IOCON).
which is shared between the ports and
affects both equally.
8-Bit Mode:
When in 8-bit mode, the ports’ registers are separated:
• Port A register addresses range from 00h – 0Ah
• Port B register addresses range from 10h – 1Ah
16-bit Mode:
When in 16-bit mode, the ports’ registers are
interleaved to emulate 16-bit wide registers:
• Port A and Port B register addresses range from
00h – 15h. The registers are still addressed as
8-bit ports, meaning that the 16-bit mapping pair
is always an even number (e.g., IODIR starts at
00h, IPOL starts at 02h, etc.)
TABLE 1: MEMORY MAP
8-bit Mode
16-bit Mode
Register
Name
IODIRA
IPOLA
GPINTENA
DEFVALA
INTCONA
IOCON
GPPUA
INTFA
INTCAPA
GPIOA
OLATA
IODIRB
IPOLB
GPINTENB
DEFVALB
INTCONB
IOCON
GPPUA
INTFB
INTCAPB
GPIOB
OLATB
Address
(hex)
00
01
02
03
04
05
06
07
08
09
0A
10
11
12
13
14
15
16
17
18
19
1A
Register
Name
IODIRA
IODIRB
IPOLA
IPOLB
GPINTENA
GPINTENB
DEFVALA
DEFVALB
INTCONA
INTCONB
IOCON
IOCON
GPPUA
GPPUB
INTFA
INTFB
INTCAPA
INTCAPB
GPIOA
GPIOB
OLATA
OLATB
Address
(hex)
00
01
02
03
04
05
06
07
08
09
0A
0B
0C
0D
0E
0F
10
11
12
13
14
15
DS01043A-page 2
© 2006 Microchip Technology Inc.