Memory, RTC & Bus Control

# Microchip MCP23017 in the datasheet corpus

16-bit I2C GPIO port expander with per-pin direction, pull-ups and interrupt-on-change.

standing: provisional I2C 0x20-0x27 (A2:A0 pins, up to 1.7 MHz)

Vendor Microchip Memory, RTC & Bus Control

Interface I2C 0x20-0x27 (A2:A0 pins, up to 1.7 MHz)

Record Status Catalog profile Datasheet / behavioral twin

## Driver oracle & capability record

Indexed in the CircuitTwin datasheet corpus (gpio-led-pwm class); supports both IOCON.BANK=0 and BANK=1 address maps.

| Driver reference  | Zephyr microchip,mcp230xx / Adafruit MCP23017                                                                                                   |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Evidence standing | provisional (register and bus behavior derived from vendor datasheet or driver oracle; not yet hardware-unit verified on two physical samples). |
| Published record  | Generate or inspect locally via ct twin generate (see [/docs/twin-generation](https://circuittwin.ai/docs/twin-generation)).                    |

## Key registers & reset values

| Address / Field | Register        | Reset / Expected  | Purpose                                         |
| --------------- | --------------- | ----------------- | ----------------------------------------------- |
| 0x00 / 0x01     | IODIRA / IODIRB | 0xFF (all inputs) | Port A and Port B pin direction masks (BANK=0)  |
| 0x0C / 0x0D     | GPPUA / GPPUB   | 0x00              | 100 kOhm internal pull-up enable per pin        |
| 0x12 / 0x13     | GPIOA / GPIOB   | Pin state         | Port read/write registers                       |
| 0x0E-0x11       | INTFA..INTCAPB  | Latched state     | Interrupt flag and captured pin state on change |

## Attach with ct CLI

Shell - run firmware with MCP23017

```
# Run compiled firmware with MCP23017 attached on nucleo-f446re
ct run --json --board nucleo-f446re --device mcp23017 build/app.elf

# Run fault-injection suite and emit JUnit XML
ct test run --json --junit results/mcp23017.xml tests/mcp23017-fault.suite.yaml
```

## Fault-injection test snippet (suite.yaml)

tests/mcp23017-fault.suite.yaml

```
version: 1
board: nucleo-f446re
firmware: build/app.elf
tests:
  - name: mcp23017-i2c-nack-recovery
    faults:
      - at_ms: 30
        bus: I2C1
        kind: nack
        address: 0x20
        count: 2
      - at_ms: 140
        part: mcp23017
        kind: register_override
        register: 0x00
        value: 0xFF
    expect:
      console_contains: "DRIVER_FAULT_HANDLED"
      exit_code: 0
```

## Compatible board twins

[Board: nucleo-f446re](https://circuittwin.ai/boards/nucleo-f446re) [Board: rpi-pico](https://circuittwin.ai/boards/rpi-pico) [Board: arduino-mega2560](https://circuittwin.ai/boards/arduino-mega2560) [Accuracy report](https://circuittwin.ai/docs/accuracy)

## More in Memory, RTC & Bus Control

[24LC256 (Microchip)](https://circuittwin.ai/twins/24lc256) [AT24C256C (Microchip)](https://circuittwin.ai/twins/at24c256c) [ATECC608A (Microchip)](https://circuittwin.ai/twins/atecc608a) [DS1307 (Analog)](https://circuittwin.ai/twins/ds1307) [DS3231 (Analog)](https://circuittwin.ai/twins/ds3231) [FM24CL64B (Infineon)](https://circuittwin.ai/twins/fm24cl64b)

> ## Inject MCP23017 bus faults in CI
>
> Wire MCP23017 onto your MCU board twin, drive physical stimuli and fail builds when your driver hangs on NACKs or frozen registers.
>
> [Start now](https://app.circuittwin.ai/try) [Inputs & fault injection docs](https://circuittwin.ai/docs/inputs) [Connect a coding agent](https://circuittwin.ai/docs/agents)
