Skip to datasheet
16-bit register-controlled I²C port expander

MCP23017 Reference Tables

Search the MCP23017 pin reference and manufacturer-referenced specification tables.

Package view
Selected packageSPDIP-28MCP23017-E/SP
Physical connections28 pinsPackage-specific numbering
Reference collection8 tables59 parameters & pin functions

Pin reference

Signal names, electrical functions and connection guidance

SPDIP-28
Physical pin numbers28 pins

Scroll within the table to see all columns and rows.

MCP23017 pin functions and connections
PinSignalTypeFunction & connection
GPB0Configurable digital I/OPort B bit 0; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPB1Configurable digital I/OPort B bit 1; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPB2Configurable digital I/OPort B bit 2; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPB3Configurable digital I/OPort B bit 3; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPB4Configurable digital I/OPort B bit 4; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPB5Configurable digital I/OPort B bit 5; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPB6Configurable digital I/OPort B bit 6; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPB7Output onlyThe current MCP23017 datasheet restricts this terminal to output use. Do not allocate it to a switch or sensor input.
Connection guidance

Configure as output LOW and leave open when unused.

GPA7 / GPB7 output-only restriction is specific to MCP23017; do not inherit MCP23S17 input capability.

VDDSupplyPowers logic and I/O. Supply, temperature and bus-rate conditions must be considered together.
Connection guidance

Use +5 V and 100 nF to VSS10.

VSSGroundSupply and signal reference.
Connection guidance

Join controller ground.

NCNo connectionNot used on the I²C MCP23017.
Connection guidance

Leave unconnected.

This is CS on the different SPI MCP23S17.

SCLI²C clock inputClock for register transfers.
Connection guidance

Connect to host SCL and a suitable pull-up to +5 V.

100 kHz example; faster modes require their own voltage and timing conditions.

SDAI²C data I/OOpen-drain serial data line.
Connection guidance

Connect to host SDA and a suitable pull-up to +5 V.

NCNo connectionNot used on the I²C MCP23017.
Connection guidance

Leave unconnected.

This is SO on the different SPI MCP23S17.

A0Address inputSets hardware address bit 0; all three LOW select 0x20.
Connection guidance

Tie directly to GND in the example.

Do not leave address inputs floating.

A1Address inputSets hardware address bit 1; all three LOW select 0x20.
Connection guidance

Tie directly to GND in the example.

Do not leave address inputs floating.

A2Address inputSets hardware address bit 2; all three LOW select 0x20.
Connection guidance

Tie directly to GND in the example.

Do not leave address inputs floating.

RESET̅Active-LOW reset inputResets registers and places outputs in the reset state.
Connection guidance

Use a 10 kΩ pull-up to +5 V and a controller or reset switch to GND.

Minimum LOW reset pulse is 1 µs.

INTBPort B interruptConfigurable polarity and push-pull/open-drain output. May be mirrored with INTA through IOCON.
Connection guidance

Leave open in this example; port B interrupts are disabled.

INTAPort A interruptReports enabled input conditions. GPIO or INTCAP reads clear the associated interrupt as specified.
Connection guidance

Use open-drain mode with 10 kΩ pull-up to +5 V and connect host IRQ.

IOCON.ODR = 1 enables open-drain, active-LOW operation.

GPA0Configurable digital I/OPort A bit 0; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Connect LED cathode; anode through 1 kΩ to +5 V.

Read GPIO for terminal levels and OLAT for the output latch.

GPA1Configurable digital I/OPort A bit 1; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Connect pushbutton to GND; enable input mode and weak pull-up.

Read GPIO for terminal levels and OLAT for the output latch.

GPA2Configurable digital I/OPort A bit 2; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPA3Configurable digital I/OPort A bit 3; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPA4Configurable digital I/OPort A bit 4; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPA5Configurable digital I/OPort A bit 5; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPA6Configurable digital I/OPort A bit 6; IODIR selects input/output, GPPU enables weak pull-up, and interrupt registers control input-change detection.
Connection guidance

Leave open with input weak pull-up enabled in this example.

Read GPIO for terminal levels and OLAT for the output latch.

GPA7Output onlyThe current MCP23017 datasheet restricts this terminal to output use. Do not allocate it to a switch or sensor input.
Connection guidance

Configure as output LOW and leave open when unused.

GPA7 / GPB7 output-only restriction is specific to MCP23017; do not inherit MCP23S17 input capability.

SPDIP-28 · Top view · Select a pin number to open its interactive pinout.

Useful register map

IOCON.BANK = 0

Manufacturer-referenced values11 parameters

Scroll within the table to see all columns and rows.

ParameterValueConditions / notes
IODIRA / IODIRB0x00 / 0x011 = input; 0 = output; obey bit-7 restriction
IPOLA / IPOLB0x02 / 0x03Input polarity inversion
GPINTENA / GPINTENB0x04 / 0x05Interrupt enable per input
DEFVALA / DEFVALB0x06 / 0x07Default comparison values
INTCONA / INTCONB0x08 / 0x09Previous-state versus default comparison
IOCON0x0A or 0x0BBANK, MIRROR, SEQOP, ODR and polarity
GPPUA / GPPUB0x0C / 0x0DWeak input pull-up enables
INTFA / INTFB0x0E / 0x0FWhich enabled pins triggered
INTCAPA / INTCAPB0x10 / 0x11Captured port values at interrupt
GPIOA / GPIOB0x12 / 0x13Read terminal levels; writes update latch
OLATA / OLATB0x14 / 0x15Read/write output latches

Changing IOCON.BANK changes register addresses. These values intentionally use the reset BANK = 0 arrangement.

Example initialization

5 V · address 0x20 · BANK = 0

Manufacturer-referenced values9 parameters

Scroll within the table to see all columns and rows.

ParameterValueConditions / notes
IOCON 0x0AWrite 0x04Open-drain INTA/B; BANK remains 0
OLATA 0x14Write 0x01Preload GPA0 HIGH so LED starts off
OLATB 0x15Write 0x00Preload unused GPB7 output LOW
IODIRA 0x00Write 0x7EA0 and A7 outputs; A1–A6 inputs
IODIRB 0x01Write 0x7FB7 output; B0–B6 inputs
GPPUA / GPPUBWrite 0x7E / 0x7FDefine unused inputs and pull button HIGH
INTCONA 0x08Write 0x00Compare enabled inputs with previous value
GPIOA 0x12Read onceEstablish current state before enabling interrupt
GPINTENA 0x04Write 0x02Enable GPA1 change notification

This sequence reserves both bit-7 pins for outputs and leaves the other unused lines safely defined.

Example control and interrupt service

Separate the output latch from input samples

Manufacturer-referenced values7 parameters

Scroll within the table to see all columns and rows.

ParameterValueConditions / notes
LED onOLATA bit0 = 0GPA0 sinks current through the LED
LED offOLATA bit0 = 1GPA0 is HIGH
Button stateGPIOA bit1LOW when button shorts to GND
Captured eventRead INTCAPA 0x10Read before another operation clears the event
Interrupt sourceRead INTFA 0x0EFlag bits identify enabled causes
Output updatesUse OLAT or a software shadowAvoid rewriting sampled input levels as outputs
Firmware debounceRequired for a mechanical buttonInterrupt edges are not automatically debounced

GPIO/INTCAP reads have interrupt-clear side effects. Design the service order deliberately.

Supply and I/O limits

Conditions distinguish the operating ranges

Manufacturer-referenced values10 parameters

Scroll within the table to see all columns and rows.

ParameterValueConditions / notes
VDD at −40 to +85°C1.8–5.5 VBus-rate constraints still apply
VDD at +85 to +125°C4.5–5.5 VSelected E-grade high-temperature operation
GPIO / bus / reset HIGH≥ 0.8 VDDSchmitt-trigger inputs
GPIO / bus / reset LOW≤ 0.2 VDDSchmitt-trigger inputs
Address HIGH / LOW≥ 0.25 VDD + 0.8 V / ≤ 0.15 VDDA0, A1 and A2
GPIO LOW≤ 0.6 V at 8 mAVDD 4.5 V
GPIO HIGH≥ VDD − 0.7 V at −3 mAVDD 4.5 V
Weak pull-up current75 µA typical; 40–115 µAVDD 5 V; pin at GND
Supply current1 mA maximumSCL/SCK 1 MHz
Standby current1 µA max. through +85°C3 µA max. at +85–125°C and 4.5–5.5 V

The 25 mA per-output figure is an absolute maximum; loaded voltage specifications provide the usable drive conditions.

Bus-rate and reset requirements

Use the correct supply for each mode

Manufacturer-referenced values7 parameters

Scroll within the table to see all columns and rows.

ParameterValueConditions / notes
100 kHzVDD 1.8–5.5 VSCL HIGH ≥4 µs; LOW ≥4.7 µs
400 kHzVDD 2.7–5.5 VSCL HIGH ≥0.6 µs; LOW ≥1.3 µs
1.7 MHzVDD 4.5–5.5 VSCL HIGH ≥0.12 µs; LOW ≥0.32 µs
Bus capacitance400 pF at 100/400 kHz100 pF at 1.7 MHz
Maximum rise time1000 / 300 / 160 ns100 kHz / 400 kHz / 1.7 MHz
Reset LOW pulse1 µs minimumRESET must be externally biased
Output update delay500 ns maximumSpecified GPIO timing conditions

The example uses 100 kHz and 4.7 kΩ pull-ups on a short bus. Recalculate pull-ups for the actual capacitance and speed.

Physical wiring

SPDIP-28 / SOIC-28 selected pin map

Manufacturer-referenced values8 parameters

Scroll within the table to see all columns and rows.

ParameterValueConditions / notes
PowerVDD9 +5 V; VSS10 GND100 nF at the IC
I²CSCL12 and SDA134.7 kΩ pull-ups to +5 V
AddressA0 pin15, A1 pin16, A2 pin17 to GND7-bit address 0x20
ResetRESET18 with 10 kΩ pull-upController reset or switch may pull LOW
LEDGPA0 pin21 to cathodeAnode through 1 kΩ to +5 V
ButtonGPA1 pin22 to switch to GNDGPPUA bit1 enabled
InterruptINTA20 to host IRQ10 kΩ pull-up; IOCON.ODR = 1
Unused terminalsNC11/14 and INTB19 openA7/B7 outputs LOW and open; other unused GPIO pulled up

The controller and pull-ups use the same 5 V logic domain. Do not assume 3.3 V meets the 5 V input HIGH threshold.

Packages and stress limits

MCP23017-E/SP · SPDIP-28

Manufacturer-referenced values7 parameters

Scroll within the table to see all columns and rows.

ParameterValueConditions / notes
SP packageSPDIP-28; 2.54 mm pitch7.62 mm row spacing
SO packageWide SOIC-28; 1.27 mm pitch7.50 mm body width
NC pins11 and 14 on these packagesThe imported logical symbol has 26 electrical pins; the physical map has 28
Maximum output current±25 mA absolute maximum per pinNot a recommended continuous target
Supply/ground absolute current125 mA into VDD; 150 mA out of VSSSum loads and observe thermal limits
Storage temperature−65 to +150°CUnpowered
MCP23S17 distinctionSPI interface and different pin useDo not copy its CS/SO wiring or bit-7 input capability

Package selection preserves the physical pin numbers and uses the appropriate footprint.

Read each value with its conditions

Typical values describe the stated test conditions. Absolute maximum ratings are stress limits, not operating targets.

Microchip Technology · DS20001952D · 2022
Official PDF datasheet

Component view