Microchip MCP23017/MCP23S17 16-Bit I/O Expander with Serial Interface

Datasheet for Microchip's MCP23017 (I2C) and MCP23S17 (SPI) 16-bit I/O expanders.

Features

Packages

Functional Block Diagram

The MCP23X17 integrates an SPI interface (MCP23S17) or an I2C interface (MCP23017). Both interfaces connect to a Serializer/Deserializer, which communicates with a Control block. The Control block manages Configuration/Control Registers and interacts with the Interrupt Logic. The device features two 8-bit GPIO ports (PORTA and PORTB) connected to the Control block, providing 16-bit bidirectional I/O expansion. Control signals include CS, SCK, SI, SO for SPI, and SCL, SDA for I2C. Other control signals include A2:A0 for addressing and RESET, INTA, INTB for interrupt and reset functions.

Electrical Characteristics

Absolute Maximum Ratings

Notice: Stresses above those listed under "Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at those or any other conditions above those indicated in the operational listings of this specification is not implied. Exposure to maximum rating conditions for extended periods may affect device reliability.

DC Characteristics

Param. No. Characteristic Sym. Min. Typ.(1) Max. Units Conditions
D001Supply VoltageVDD1.8--5.5V--
D002VDD Start Voltage to ensure Power-on ResetVPOR----VSSV--
D003VDD Rise Rate to ensure Power-on ResetSVDD--0.05--V/msDesign guidance only. Not tested.
D004Supply CurrentIDD----1mASCL/SCK = 1 MHz
D005Standby currentIDDS8----1μA-40°C ≤ TA ≤ +85°C
----3μA4.5V ≤ VDD ≤ 5.5V, +85°C ≤ TA ≤+125°C (Note 1)
Input Low Voltage
D030A0, A1, A2 (TTL buffer)VILVSS--0.15 VDDV--
D031CS, GPIO, SCL/SCK, SDA, RESET (Schmitt Trigger)VILVSS--0.2 VDDV--
Input High Voltage
D040A0, A1, A2 (TTL buffer)VIH0.25 VDD + 0.8--VDDV--
D041CS, GPIO, SCL/SCK, SDA, RESET (Schmitt Trigger)VIH0.8 VDD--VDDVFor entire VDD range
Input Leakage Current
D060I/O port pinsIIL----±1μAVSS ≤ VPIN ≤ VDD
Output Leakage Current
D065I/O port pinsILO----±1μAVSS ≤ VPIN ≤ VDD
D070GPIO weak pull-up currentIPU4075115μAVDD = 5V, GP pins = VSS
Output Low-Voltage
D080GPIOVOL----0.6VIOL = 8.0 mA, VDD = 4.5V
INTVOL----0.6VIOL = 1.6 mA, VDD = 4.5V
SO, SDAVOL----0.6VIOL = 3.0 mA, VDD = 1.8V
SDAVOL----0.8VIOL = 3.0 mA, VDD = 4.5V
Output High-Voltage
D090GPIO, INT, SOVOHVDD - 0.7--VDD - 0.7VIOH = -3.0 mA, VDD = 4.5V; IOH = -400 μA, VDD = 1.8V
Capacitive Loading Specs on Output Pins
D101GPIO, SO, INTCIO----50pF--
D102SDACB----400pF--

AC Characteristics

Load Conditions for Device Timing Specifications

The timing specifications are measured under specific load conditions. For I2C, this includes a 1 kΩ pull-up resistor (RPU) and a 135 pF load capacitance (CL) on SCL and SDA pins. For SPI, typical conditions are also provided.

Reset and Device Reset Timer Timing

Diagrams illustrate the timing for RESET pulse width (TRSTL), device active after reset high (THLD), and output high-impedance from RESET low (TIOZ).

Param. No. Characteristic Sym. Min. Typ. (1) Max. Units Conditions
30RESET Pulse Width (Low)TRSTL1----μs--
32Device Active After Reset highTHLD--0--nsVDD = 5.0V
34Output High-Impedance From RESET LowTIOZ----1μs--

I2C Bus Timing

Timing diagrams show the START/STOP bits and data transfer sequences for I2C communication. Key parameters include Clock High Time (THIGH), Clock Low Time (TLOW), SDA and SCL Rise/Fall Times (TR, TF), START Condition Setup/Hold Times (TSU:STA, THD:STA), Data Input Hold/Setup Times (THD:DAT, TSU:DAT), Stop Condition Setup Time (TSU:STO), Output Valid From Clock (TAA), Bus Free Time (TBUF), Bus Capacitive Loading (CB), and Input Filter Spike Suppression (TSP).

Param. No. Characteristic Sym. Min. Typ. Max. Units Conditions
100Clock High Time:THIGH4.0----μs100 kHz mode: 1.8V - 5.5V
0.6----μs400 kHz mode: 2.7V - 5.5V
0.12----μs1.7 MHz mode: 4.5V - 5.5V
101Clock Low Time:TLOW4.7----μs100 kHz mode: 1.8V - 5.5V
1.3----μs400 kHz mode: 2.7V - 5.5V
0.32----μs1.7 MHz mode: 4.5V - 5.5V
102SDA and SCL Rise Time:TR (1)20 + 0.1 CB (2)--1000ns100 kHz mode: 1.8V - 5.5V
20--300ns400 kHz mode: 2.7V - 5.5V
20--160ns1.7 MHz mode: 4.5V - 5.5V
103SDA and SCL Fall Time:TF (1)----300ns100 kHz mode: 1.8V - 5.5V
20 + 0.1 CB (2)--300ns400 kHz mode: 2.7V - 5.5V
20--80ns1.7 MHz mode: 4.5V - 5.5V
90START Condition Setup Time:TSU:STA4.7----μs100 kHz mode: 1.8V - 5.5V
0.6----μs400 kHz mode: 2.7V - 5.5V
0.16----μs1.7 MHz mode: 4.5V - 5.5V
91START Condition Hold Time:THD:STA4.0----μs100 kHz mode: 1.8V - 5.5V
0.6----μs400 kHz mode: 2.7V - 5.5V
0.16----μs1.7 MHz mode: 4.5V - 5.5V
106Data Input Hold Time:THD:DAT0--3.45μs100 kHz mode: 1.8V - 5.5V
0--0.9μs400 kHz mode: 2.7V - 5.5V
0--0.15μs1.7 MHz mode: 4.5V - 5.5V
107Data Input Setup Time:TSU:DAT250----ns100 kHz mode: 1.8V - 5.5V
100----ns400 kHz mode: 2.7V - 5.5V
0.01----μs1.7 MHz mode: 4.5V - 5.5V
92Stop Condition Setup Time:TSU:STO4.0----μs100 kHz mode: 1.8V - 5.5V
0.6----μs400 kHz mode: 2.7V - 5.5V
0.16----μs1.7 MHz mode: 4.5V - 5.5V
109Output Valid From Clock:TAA----3.45μs100 kHz mode: 1.8V - 5.5V
----0.9μs400 kHz mode: 2.7V - 5.5V
----0.18μs1.7 MHz mode: 4.5V - 5.5V
110Bus Free Time:TBUF4.7----μs100 kHz mode: 1.8V - 5.5V
1.3----μs400 kHz mode: 2.7V - 5.5V
N/A--N/Aμs1.7 MHz mode: 4.5V - 5.5V
111Bus Capacitive Loading:CB----400pF100 kHz and 400 kHz (Note 1)
----100pF1.7 MHz (Note 1)
112Input Filter Spike Suppression (SDA and SCL):TSP----50ns100 kHz and 400 kHz
----10ns1.7 MHz (Spike suppression off)

SPI Interface Timing

Timing diagrams illustrate SPI input and output operations, including Chip Select (CS), Clock (SCK), Serial Data Input (SI), and Serial Data Output (SO). Key parameters include Clock Frequency (FCLK), CS Setup/Hold Times (TCSS, TCSH), CS Disable Time (TCSD), Data Setup/Hold Times (TSU, THD), CLK Rise/Fall Times (TR, TF), Clock High/Low Times (THI, TLO), Clock Delay Time (TCLD), Clock Enable Time (TCLE), Output Valid from Clock Low (TV), Output Hold Time (THO), and Output Disable Time (TDIS).

Param. No. Characteristic Sym. Min. Typ. Max. Units Conditions
--Clock FrequencyFCLK--5--MHz1.8V – 5.5V
--10--MHz2.7V – 5.5V
--10--MHz4.5V – 5.5V
1CS Setup TimeTCSS50----ns--
2CS Hold TimeTCSH100----ns1.8V-5.5V
50----ns2.7V - 5.5V
3CS Disable TimeTCSD100----ns1.8V-5.5V
50----ns2.7V - 5.5V
4Data Setup TimeTSU20----ns1.8V-5.5V
10----ns2.7V - 5.5V
5Data Hold TimeTHD20----ns1.8V-5.5V
10----ns2.7V -5.5V
6CLK Rise TimeTR----2μsNote 1
7CLK Fall TimeTF----2μsNote 1
8Clock High TimeTHI90----ns1.8V-5.5V
45----ns2.7V - 5.5V
9Clock Low TimeTLO90----ns1.8V - 5.5V
45----ns2.7V - 5.5V
10Clock Delay TimeTCLD50----ns--
11Clock Enable TimeTCLE50----ns--
12Output Valid from Clock LowTV----90ns1.8V-5.5V
----45ns2.7V -5.5V
13Output Hold TimeTHO0----ns--
14Output Disable TimeTDIS----100ns--

GPIO and INT Timing

Timing diagrams illustrate GPIO and INT pin behavior, including data capture for interrupts (INT Pin Active/Inactive) and register loading.

Pin Descriptions

The MCP23017 and MCP23S17 have 28 pins, offering bidirectional I/O, power, ground, address pins, reset, and interrupt outputs. The pin functions vary slightly based on package type (QFN, SOIC, SPDIP, SSOP).

Pin Name QFN SOIC/SPDIP/SSOP Pin Type Function
GPB0-GPB725-28, 1-41-8I/OBidirectional I/O pin, configurable for interrupt-on-change and/or internal weak pull-up resistor.
VDD59PPower
VSS610PGround
NC/CS711INC (MCP23017)/Chip Select (MCP23S17)
SCK812ISerial clock input
SDA/SI913I/OSerial data I/O (MCP23017)/Serial data input (MCP23S17)
NC/SO1014ONC (MCP23017)/Serial data out (MCP23S17)
A0, A1, A211-1315-17IHardware address pins. Must be externally biased.
RESET1418IHardware reset. Must be externally biased.
INTB1519OInterrupt output for PORTB. Configurable as active-high, active-low or open-drain.
INTA1620OInterrupt output for PORTA. Configurable as active-high, active-low or open-drain.
GPA0-GPA717-2421-28I/OBidirectional I/O pin, configurable for interrupt-on-change and/or internal weak pull-up resistor.
EP29----Exposed Thermal Pad. Connect to VSS or leave unconnected.

Device Overview

The MCP23017/MCP23S17 (MCP23X17) family provides 16-bit parallel I/O expansion via I2C (MCP23017) or SPI (MCP23S17) interfaces. It features multiple 8-bit configuration registers for input/output direction, polarity, and interrupt control. The 16-bit I/O port is split into two 8-bit ports (PORTA and PORTB) and can operate in 8-bit or 16-bit modes. The device includes configurable interrupt pins (INTA, INTB) and supports interrupt-on-change functionality based on pin state changes or comparison with default values. Hardware address pins (A0-A2) allow up to eight devices on the bus.

Power-on Reset (POR)

An on-chip POR circuit holds the device in reset until VDD reaches a sufficient voltage level. Upon exiting POR, device parameters must meet operating conditions for proper function.

Serial Interface

This block manages the I2C (MCP23017) or SPI (MCP23S17) protocol. The MCP23X17 has 22 registers (11 pairs) accessible via the serial interface. The device supports Byte mode (disables address pointer increment) and Sequential mode (enables address pointer increment). Both I2C and SPI interfaces support sequential write/read operations.

Register Name Address (hex) IOCON.BANK = 1 Address (hex) IOCON.BANK = 0 Access to:
IODIRA00h00hIODIRA
IODIRB10h01hIODIRB
IPOLA01h02hIPOLA
IPOLB11h03hIPOLB
GPINTENA02h04hGPINTENA
GPINTENB12h05hGPINTENB
DEFVALA03h06hDEFVALA
DEFVALB13h07hDEFVALB
INTCONA04h08hINTCONA
INTCONB14h09hINTCONB
IOCON05h0AhIOCON
IOCON15h0BhIOCON
GPPUA06h0ChGPPUA
GPPUB16h0DhGPPUB
INTFA07h0EhINTFA
INTFB17h0FhINTFB
INTCAPA08h10hINTCAPA
INTCAPB18h11hINTCAPB
GPIOA09h12hGPIOA
GPIOB19h13hGPIOB
OLATA0Ah14hOLATA
OLATB1Ah15hOLATB

Register Summary

The device features numerous registers for configuring I/O direction, polarity, interrupt behavior, pull-up resistors, and general device configuration. Key registers include IODIR (I/O Direction), IPOL (Input Polarity), GPINTEN (Interrupt Enable), DEFVAL (Default Value), INTCON (Interrupt Control), IOCON (Configuration), GPPU (Pull-up Resistor), INTF (Interrupt Flag), INTCAP (Interrupt Captured Value), GPIO (Port Register), and OLAT (Output Latch).

I/O Direction Register (IODIR)

Controls the direction of data I/O. A set bit configures the pin as an input; a clear bit configures it as an output.

Input Polarity Register (IPOL)

Allows configuration of polarity for GPIO port bits. A set bit reflects the inverted input pin state.

Interrupt-on-Change Control Register (GPINTEN)

Enables/disables interrupt-on-change for each pin. DEFVAL and INTCON registers must also be configured.

Default Value Register (DEFVAL)

Sets the compare value for pins configured for interrupt-on-change. An opposite pin level triggers an interrupt.

Interrupt Control Register (INTCON)

Controls how the pin value is compared for interrupt-on-change. A set bit compares against DEFVAL; a clear bit compares against the previous pin value.

Configuration Register (IOCON)

Contains bits for configuring the device, including BANK (register mapping), MIRROR (INT pin behavior), SEQOP (sequential operation mode), DISSLW (SDA slew rate), HAEN (hardware address enable for MCP23S17), ODR (INT pin open-drain), and INTPOL (INT pin polarity).

Pull-Up Resistor Configuration Register (GPPU)

Controls weak pull-up resistors on port pins. A set bit enables the pull-up for input pins.

Interrupt Flag Register (INTF)

Reflects interrupt conditions on pins enabled for interrupts. A set bit indicates the pin caused the interrupt. This register is read-only.

Interrupt Captured Register (INTCAP)

Captures the GPIO port value at the time of an interrupt. Read-only, updated only when an interrupt occurs.

Port Register (GPIO)

Reflects the logic level on the pins. Reading this register reads the port value. Writing modifies the Output Latch (OLAT).

Output Latch Register (OLAT)

Provides access to output latches. Writing modifies latches that drive pins configured as outputs.

Interrupt Logic

The MCP23X17 activates INTn interrupts when port pins change state or do not match a preconfigured default. Interrupts can be enabled via GPINTEN and configured via INTCON and DEFVAL. The IOCON.MIRROR bit controls whether INTA and INTB are mirrored. Interrupts can be triggered by pin changes or by mismatches with the DEFVAL register.

Interrupt Operation

INT pins can be configured as active-low, active-high, or open-drain. Only input pins with Interrupt-on-Change enabled can trigger an interrupt. Input activity captures the port value into INTCAP. The interrupt remains active until INTCAP or GPIO is read. The first interrupt event captures port contents; subsequent events are ignored until the interrupt is cleared.

Interrupt Conditions

Two primary interrupt conditions are supported:

  1. Interrupt-on-pin change: An interrupt occurs if a pin changes to the opposite state. The state is reset after the interrupt is cleared.
  2. Interrupt-on-change from register value: An interrupt occurs if an input pin differs from its corresponding register bit (DEFVAL). The condition persists until cleared by reading INTCAP or GPIO.

Packaging Information

The MCP23017/MCP23S17 are available in several package types:

Package marking includes device number, temperature range, package type, and traceability codes. Specific dimensions and land patterns are provided for each package type.

Revision History

Product Identification System

The part number structure indicates the device (MCP23017/MCP23S17), temperature range (E for extended), package type (ML, SO, SP, SS), and tape/reel option (T for Tape and Reel, Blank for Tube). For example, MCP23017-E/ML denotes an extended temperature MCP23017 in a QFN package.

Trademarks and Disclaimers

Microchip Technology Incorporated holds various registered trademarks and service marks, including Microchip, PIC, dsPIC, and others listed in the document. The company disclaims liability for information provided and advises users to ensure their applications meet specifications. Use in life support/safety applications is at the buyer's risk.

PDF preview unavailable. Download the PDF instead.

20001952C Acrobat Distiller 15.0 (Windows)

Related Documents

Preview Microchip Focus Product Selector Guide
A comprehensive guide to Microchip's extensive range of microcontrollers, microprocessors, and related embedded solutions, detailing their features and applications across various industries.
Preview Microchip 25AA256/25LC256: 256K SPI Bus Serial EEPROM Datasheet
Datasheet for Microchip's 25AA256/25LC256, a 256-Kbit SPI Bus Serial EEPROM. Details features, electrical characteristics, AC characteristics, pin descriptions, functional description, instruction set, read/write sequences, status register, data protection, power-on state, packaging information, and product identification.
Preview SST25VF080B 8-Mbit SPI Serial Flash Memory Datasheet
This datasheet provides comprehensive technical information for Microchip Technology's SST25VF080B, an 8-Mbit SPI Serial Flash memory device. It details features, specifications, pin descriptions, device operation, instructions, electrical characteristics, AC timing, and packaging information.
Preview Microchip MCP4725: 12-Bit DAC with EEPROM - Datasheet
Explore the Microchip MCP4725, a 12-bit digital-to-analog converter featuring on-board EEPROM, I2C interface, and rail-to-rail output. View technical specifications, performance curves, and application notes.
Preview MCP2518FD: External CAN FD Controller with SPI Interface Datasheet
Datasheet for the Microchip MCP2518FD, an external CAN FD controller with SPI interface. Features include support for CAN 2.0B and CAN FD formats, multiple FIFOs, flexible filters, and various oscillator options.
Preview Microchip dsPIC30F Interrupt System: A Technical Overview
Explore the interrupt controller architecture of Microchip's dsPIC30F digital signal processors. This guide covers interrupt vector tables, priority management, trap handling, and timing for embedded system development.
Preview Microchip PIC12LF1840T39A Product Brief: Features, Specifications, and Pinout
Comprehensive product brief for the Microchip PIC12LF1840T39A microcontroller, detailing its high-performance RISC CPU, flexible oscillator, low-power features, RF transmitter capabilities, analog and peripheral features, pin allocation, and technical specifications.
Preview MPLAB ICD 4 In-Circuit Debugger User's Guide - Microchip Technology
Official user's guide for the Microchip MPLAB ICD 4 In-Circuit Debugger (DV164045). Covers setup, operation, debugging, programming, hardware specifications, and troubleshooting for PIC and dsPIC embedded development.