Extend Serial I/O Unit (PCA9554PW)

via M5Stack
$5.79
SKU M5-U011

We have 8 units in our Sydney Warehouse available for immediate dispatch.

Description

EXT.IO is a GOIO Expander. With simple I2C commands you can have up to 8 GPIOs.

Integrates PCA9554PW. This 8-bit I/O expander for the two-line bidirectionalbus (I2C) is designed for 2.3-V to 5.5-V VCC, Open-Drain Active-Low Interrupt Output operation. It provides general-purpose remote I/O expansion for most microcontroller families via the I2C interface.

IIC address: 0x27.

It’s difficult to foresee the needs of your project from the start. EXT.IO is the perfect solution for expanding the number of IO. It allows you to add new features, logic,timing and sensing to alrady highly integrated designs.

Product Features

  • Expanded I/O number: 8
  • Program Platform : Arduino, UIFlow(Blockly, Python)
  • Two Lego-compatible holes

Kit includes

  • 1x EXT.IO Unit
  • 1x Grove Cable
Documents
Learn

Example

1. Arduino IDE

To get the complete code, please click here

/*
    Connect to GRVOE A on M5Core
*/
#include <M5Stack.h>
#include "PCA9554.h" // Load the PCA9554 Library

// new a object
PCA9554 ioCon1(0x27);

uint8_t res;

// initialization

M5.begin();
Wire.begin();
ioCon1.twiWrite(21, 22); // GROVE A
delay(10);
res = 1;
ioCon1.twiRead(res);
Serial.printf("res:%d\r\n", res);
ioCon1.portMode0(ALLOUTPUT); //Set the port as all output

// set the specific pin
ioCon1.digitalWrite0(0, HIGH);
ioCon1.digitalWrite0(1, HIGH);
ioCon1.digitalWrite0(2, HIGH);
ioCon1.digitalWrite0(3, HIGH);
ioCon1.digitalWrite0(4, HIGH);
ioCon1.digitalWrite0(5, HIGH);
ioCon1.digitalWrite0(6, HIGH);
ioCon1.digitalWrite0(7, HIGH);

// write 0-7 HIGHT
Serial.println(ioCon1.digitalWritePort0(0xff));

// write 0-7 LOW
Serial.println(ioCon1.digitalWritePort0(0x00));

2. UIFlow

To get the complete code, please click here.

 

More information

PinMap

M5Core(GROVE A) GPIO22 GPIO21 5V GND
EXT.IO Unit SCL SDA 5V GND