The MCP23017 IO Expansion Board, manufactured by SeenGreat (Part ID: SG IO E017), is a versatile component designed to expand the number of input/output (I/O) pins available for microcontroller projects. Utilizing the MCP23017 chip, this board provides an additional 16 I/O pins via the I2C interface, making it an ideal solution for projects requiring more I/O capabilities than what is available on standard microcontrollers.
Parameter | Value |
---|---|
Operating Voltage | 1.8V to 5.5V |
I/O Pins | 16 |
Communication | I2C |
I2C Address Range | 0x20 to 0x27 (configurable) |
Maximum Current | 25mA per pin |
Package Type | DIP-28, SOIC-28 |
Pin No. | Pin Name | Description |
---|---|---|
1 | GPA0 | General Purpose I/O Pin 0 (Port A) |
2 | GPA1 | General Purpose I/O Pin 1 (Port A) |
3 | GPA2 | General Purpose I/O Pin 2 (Port A) |
4 | GPA3 | General Purpose I/O Pin 3 (Port A) |
5 | GPA4 | General Purpose I/O Pin 4 (Port A) |
6 | GPA5 | General Purpose I/O Pin 5 (Port A) |
7 | GPA6 | General Purpose I/O Pin 6 (Port A) |
8 | GPA7 | General Purpose I/O Pin 7 (Port A) |
9 | VSS | Ground |
10 | OSC1 | Oscillator Pin 1 (optional) |
11 | OSC2 | Oscillator Pin 2 (optional) |
12 | SCL | I2C Clock Line |
13 | SDA | I2C Data Line |
14 | A0 | I2C Address Pin 0 |
15 | A1 | I2C Address Pin 1 |
16 | A2 | I2C Address Pin 2 |
17 | RESET | Reset (active low) |
18 | INTB | Interrupt Output for Port B |
19 | INTA | Interrupt Output for Port A |
20 | VDD | Power Supply |
21 | GPB0 | General Purpose I/O Pin 0 (Port B) |
22 | GPB1 | General Purpose I/O Pin 1 (Port B) |
23 | GPB2 | General Purpose I/O Pin 2 (Port B) |
24 | GPB3 | General Purpose I/O Pin 3 (Port B) |
25 | GPB4 | General Purpose I/O Pin 4 (Port B) |
26 | GPB5 | General Purpose I/O Pin 5 (Port B) |
27 | GPB6 | General Purpose I/O Pin 6 (Port B) |
28 | GPB7 | General Purpose I/O Pin 7 (Port B) |
#include <Wire.h>
#include "Adafruit_MCP23017.h"
// Create an MCP23017 object
Adafruit_MCP23017 mcp;
void setup() {
// Start the I2C communication
Wire.begin();
// Initialize the MCP23017 with the default address (0x20)
mcp.begin();
// Set pin GPA0 as an output
mcp.pinMode(0, OUTPUT);
// Set pin GPA1 as an input with pull-up resistor
mcp.pinMode(1, INPUT);
mcp.pullUp(1, HIGH);
// Initialize serial communication for debugging
Serial.begin(9600);
}
void loop() {
// Read the state of pin GPA1
uint8_t pinState = mcp.digitalRead(1);
// Print the state to the serial monitor
Serial.print("GPA1 state: ");
Serial.println(pinState);
// Toggle the state of pin GPA0
mcp.digitalWrite(0, !pinState);
// Wait for 500 milliseconds
delay(500);
}
I2C Communication Failure:
Incorrect I/O Pin Behavior:
Address Conflicts:
By following this documentation, users can effectively integrate the MCP23017 IO Expansion Board into their projects, expanding their microcontroller's I/O capabilities with ease.