16-bit I/O Port Expander MCP23017 (I2C)

Microchip 16-bit I/O Port Expander MCP23017 (I2C)
Click to enlarge
Price: £1.08
(£0.90 + VAT)
Availability: 206
Model: MCP23017
Manufacturer: Microchip
Average Rating: Not Rated

Microchip

16-bit I/O Port Expander MCP23017 (I2C)

The MCP23017 is a 16-bit, general purpose parallel I/O port expander for I2C bus applications.

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

Features

  • 16-bit remote bidirectional I/O port
    - I/O pins default to input
  • • High-speed I2C™ interface (MCP23017)
    - 100 kHz
    - 400 kHz
    - 1.7MHz
  • Three hardware address pins to allow up to eight devices on the bus
  • Operating Voltage: 1.8V to 5.5V

MCP23017 Pinout

Documents

MCP23017 Datasheet

Example Arduino Code

Here is a simple Arduino 1.0 example sketch to flash an LED connected to any pin on Port B

/*
** MCP23017 16 bit Port Expander
** Example code to flash LED on GPB0
** Created 06 Aug 2012
**
** This example code is in the public domain.
** www.hobbytronics.co.uk
*/

#include <Wire.h>

const byte  mcp_address=0x20;      // I2C Address of MCP23017 Chip
const byte  GPIOA=0x12;            // Register Address of Port A
const byte  GPIOB=0x13;            // Register Address of Port B

void setup()
{
  //Send settings to MCP device
  Wire.begin();              // join i2c bus (address optional for master)

  // IOCON.BANK defaults to 0 which is what we want.
  // So we are using Table 1-4 on page 9 of datasheet
  
  Wire.beginTransmission(mcp_address);
  Wire.write((byte)0x00); // IODIRA register
  Wire.write((byte)0x00); // set all of bank A to outputs
  Wire.write((byte)0x00); // set all of bank B to outputs 
  Wire.endTransmission();
  
}

void loop()
{
  Wire.beginTransmission(mcp_address);
  Wire.write(GPIOB);      // address bank B
  Wire.write((byte)0xFF);  // value to send - all HIGH
  Wire.endTransmission();
  
  delay(500);

  Wire.beginTransmission(mcp_address);
  Wire.write(GPIOB);    // address bank B
  Wire.write((byte)0x00);  // value to send - all LOW
  Wire.endTransmission();
  
  delay(500);
}

Write Review
Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad            Good

Enter the code in the box below:

16-bit I/O Port Expander MCP23017 (I2C)
Click to enlarge
Shopping Cart
0 items
 
DELIVERY/PAYMENT

   UK ORDERS OVER £50

UK - £2.40 orders below
                    £50.00
EU Airmail from £3.95
Worldwide from £7.95
More Details...

 
Specials
 
Brands
 
Follow us on: