Gravity: MCP23017 I2C 16 Digital IO Expansion Module

SKU: DFR0626

The Gravity: MCP23017 I2C 16 Digital IO Expansion Module extends microcontroller IO capabilities with 16 additional ports, supporting up to 8 modules for a total of 128 ports, featuring configurable GPIO pins and interrupt signal detection, ideal for complex applications.

Front of MCP23017 I2C 16-Bit I/O Expander Module with multiple GPIO pins for Arduino projects.-DFRobot product sku:DFR0626 image.
  • Docs
  • Tech Specs
  • 1. Example Code for Arduino-Pin Output

    This comprehensive guide provides detailed instructions on setting up and using an Arduino with the MCP23017 IIC module for digital IO expansion. It includes hardware and software preparations, a wiring diagram, sample code for controlling pin output, and expected results, making it an ideal resource for beginners and DIY enthusiasts.

    2. Example Code for Arduino-Button Input

    This article offers a comprehensive guide on implementing button inputs for Arduino using the DFRobot MCP23017 library. It includes hardware and software preparations, wiring diagrams, and sample code to facilitate the detection and display of button status via the serial port.

    3. Example Code for Arduino-IO Interrupt

    This article provides an example code for setting up IO interrupts on Arduino using the MCP23017 library, covering hardware and software preparations, wiring diagrams, and demonstrating the interrupt service functions to detect changes and execute actions via serial port.

    4. Example Code for Arduino-Interrupt Polling

    Set the IO pins of the board to interrupt mode, such as eChangeLevel, eFalling, eRising, eHighLevel, eLowLevel. Set PA0, PA1, PB6, PB7 to eChangeLevel, eFalling, eRising, eHighLevel respectively, poll and serial print the pins where interrupt happened. Set a pin of IO expansion board to interrupt mode, poll if there is an interrupt occurring on the pins of the port. Experiment phenomenon: poll if there is an interrupt occurring on the port group(A, B, A+B), if there is, serial print the pin which is interrupted.

    Reference

    This guide provides an in-depth look at the MCP23017 library, detailing its API functions for setting pin modes, writing and reading digital pins, and managing interrupts. It explains how to configure I2C addresses using DIP switches and offers supplementary information on cascade connections and schematic layouts.

    Specification

    Parameter Details
    Power Supply 3.3V-5.5V
    IIC Address 0x20~0x27
    Digital IO/Input/Output PA0-PA7, PB0-PB7
    IO Driving Current 20mA
    Signal Interrupt Pin IA, IB
    Dimension 44x32mm / 1.73x1.26"

    Pinout

    dfr0627 Pinout
    dfr0627 Pinout
    dfr0627 Pinout

    Num Name Description
    1 +/VCC Positive
    2 -/GND Negative
    3 C IIC Clock Line
    4 D IIC Data Line
    5 RST Reset Pin
    6 IA GPIOA Interrupt Detection Pin
    7 IB GPIOB Interrupt Detection Pin
    8 PWR Power Indicator
    9 A0/A1/A2 IIC Address Switch

    Digital IO Port Table

    CPIOA 0 1 2 3 4 5 6 7
    PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7
    CPIOB 8 9 10 11 12 13 14 15
    PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7

    Each digital pin in the table can be arbitrarily configured as input or output, and a pull-up input, interrupt and so on.

    Was this article helpful?

    TOP