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

MCP23017 Basic Circuit

Build a basic MCP23017 circuit with labeled pins, component values and connection guidance.

Package view

MCP23017 in a circuit

A defined startup sequence and captured input changes.

Physical28pinMCP23017 plus5Vhost I2Cpullups resetpullup bypass LEDatGPA0 buttonGPA1 INTAinterrupt andproperunusedpinconfiguration.
Named nets connect matching labels. Initialize the registers before using the ports.

Connect it, step by step

Follow the component values and pin connections

Connect and reset

Power, bypass and reset the IC; ground A2–A0 and connect I²C.

Set directions

Preload latches, then set IODIRA 7E and IODIRB 7F. Both bit-7 pins remain outputs.

Drive and read

Write OLATA bit0 for the LED; read GPA1 or captured port A state for the button.

Component view