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

Microchip 16-bit I/O Port Expander MCP23017 (I2C)
Cliquer pour agrandir
Prix : 1,44€
(1,20€ + VAT)
Disponibilité : 129
Modèle : MCP23017
Fabricant : Microchip
Évaluation : Aucune évaluation

Quantité : + Panier Comparer
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

We also have the SPI version of this chip here MCP23S17

MCP23017 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);
}

 

Écrire un avis
Votre nom :


Votre avis : N.B. : Le HTML n'est pas pris en charge !

Évaluation : Mauvais            Bon

Saisir le code ci-dessous :

16-bit I/O Port Expander MCP23017 (I2C)
Cliquer pour agrandir
16-bit I/O Port Expander MCP23017 (I2C)
$ 44€ New In Stock
Panier
Aucun article
 
Frais de Livraison

France & EU - poste aerienne de 3.54€ +VAT
Plus d'informations...

 
Marques
 
 Check out our videos
Follow us on:
acebook