MCP2301716-bit register-controlled I²C port expander
Expand digital control with direction registers, pull-ups and captured interrupts.
MCP23017 expands an I²C host with two eight-bit digital ports. Dedicated registers select direction, output latches, input polarity, weak pull-ups and interrupt behavior. Transfers include a register address, unlike the direct port-byte interface of PCF8574. The current Microchip reference restricts GPA7 and GPB7 to output use on MCP23017. The other fourteen port pins can serve as inputs or outputs. This page follows that restriction in both the pinout and the example; it does not assume the SPI MCP23S17 has identical limitations. The 5 V example uses GPA0 for a current-limited LED and GPA1 for a button with an enabled weak pull-up. INTA is configured as an open-drain interrupt with an external pull-up. Software sets known output latches before enabling drivers, reads captured input state when handling changes, and keeps the BANK setting consistent with its register addresses.

