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

The MCP23017/MCP23S17 (MCP23X17) (CJMCU-2317) device family provides 16-bit, general-purpose parallel I/O expansion for I²C bus or SPI applications. The two devices differ only in the serial interface:

  • MCP23017 – I²C interface
  • MCP23S17 – SPI interface

The MCP23X17 contains multiple 8-bit configuration registers for input, output, and polarity selection. The system master can set I/Os as inputs or outputs by writing to the I/O configuration bits (IODIRA/B).

The data for each input or output is stored in the corresponding register. The polarity of the Input Port register can be reversed using the Polarity Inversion register. The system master can read all registers.

The 16-bit I/O port functionally consists of two 8-bit ports (PORTA and PORTB). The MCP23X17 can be configured to operate in the 8-bit or 16-bit modes via IOCON.BANK.

MCP23017 / MCP23S17 Features

Operating voltage: 1.8V to 5.5V
Voltage on Vdd with respect to Vss: -0.3V to +5.5V
Communication interface: I²C (up to 1.7 MHz), SPI (up to 10 MHz)
Number I/O Pins: 16
Interrupt pins: 2
Operating temperature: -40 °C to 125 °C
Total power dissipation: 700 mW
Maximum current out of Vss pin: 150 mA
Maximum current into Vdd pin: 125 mA

MCP23017 / MCP23S17 IC Features:

  • 16-Bit Remote Bidirectional I/O Port
    • I/O pins default to input
  • High-Speed I2C Interface (MCP23017)
    • 100 kHz
    • 400 kHz
    • 1.7 MHz
  • High-Speed SPI Interface (MCP23S17)
    • 10 MHz (maximum)
  • Three Hardware Address Pins to Allow Up to Eight Devices On the Bus
  • Configurable Interrupt Output Pins
    • Configurable as active-high, active-low, or open-drain
  • INTA and INTB Can Be Configured to Operate Independently or Together
  • Configurable Interrupt Source:
    • Interrupt-on-change from configured register defaults or pin changes
  • Polarity Inversion Register to Configure the Polarity of the Input Port Data
  • External Reset Input
  • Low Standby Current: 1 µA (max.)
  • Operating Voltage:
    • 1.8V to 5.5V @ -40°C to +85°C
    • 2.7V to 5.5V @ -40°C to +85°C
    • 4.5V to 5.5V @ -40°C to +125°C
MCP23017MCP23017MCP23017

MCP23017 / MCP23S17 Modul Pinout

Pin nameDescriptionPin nameDescriptionPin nameDescription
A2Hardware address pin; look belowVccPower supply (1.8V to 5.5V)GNDGround
A1Hardware address pin; look belowITBInterrupt output for PORTB. Can be configured as active-high, active-low, or open-drainITAInterrupt output for PORTA. Can be configured as active-high, active-low, or open-drain
A0Hardware address pin; look belowB0digital output pinA0digital input pin
RESETHardware reset. Must be externally biasedB1digital output pinA1digital input pin
NC/SOI²C nop / SPI slave outB2digital output pinA2digital input pin
NC/CSI²C nop / SPI chip selectB3digital output pinA3digital input pin
SDA/SII²C data / SPI slave inB4digital output pinA4digital input pin
SCL/SCKI²C clock / SPI clockB5digital output pinA5digital input pin
GNDGroundB6digital output pinA6digital input pin
VccPower supply (1.8V to 5.5V)B7digital output pinA7digital input pin

MCP23017 / MCP23S17 IC pins

MCP23017 / MCP23S17 IC pins

MCP23017 / MCP23S17 Functional Block Diagram

MCP23017 / MCP23S17 Functional Block Diagram

MCP23017 / MCP23S17 I²C / SPI address coding

The hardware address pins are used to determine the device address. To address a device, the corresponding address bits in the control byte must match the pin state. The pins must be biased externally.

MCP23017 / MCP23S17 I2C addressingMCP23017 / MCP23S17 SPI addressing
The MCP23017 is a slave I²C interface device that supports 7-bit addressing, with the read/write bit filling out the control byte. The slave address includes four fixed bits and three user-defined hardware address bits (pins A2, A1, and A0).The MCP23S17 is a slave SPI device. The slave address contains four fixed bits and three user-defined hardware address bits (if enabled via IOCON.HAEN) (pins A2, A1, and A0), with the read/write bit filling out the control byte

MCP23017 / MCP23S17 Source

I²C topics on lamaPLC

PageDateTags
2025/05/31 21:56, , , , , , ,
2025/05/31 21:32, , , , , , , ,
2025/11/21 23:07, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2023/07/01 15:29, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2025/11/22 20:33, , , ,
2025/09/23 19:08, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2025/10/09 21:58, , , , , ,
2025/12/03 23:01, , , , , , ,
2025/11/13 21:54, , , ,
2025/11/22 18:20, , , , , ,
2025/10/09 16:03, , , ,




This page has been accessed for: Today: 8, Until now: 12