Arduino Drivers for 8 GPIO I2C Expander Board (SX1502) Released

Arduino Drivers for 8 GPIO I2C Extender Board (SX1502) ReleasedIMG_5055 copy

A new version of the Arduino C++ Class driver software for the new product from SwitchDoc Labs, the 8 GPIO I2C Extender board, has been released.  This device just came out of a very successful (146% funded) Kickstarter campaign.

The 8 GPIO I2C Extender Board

This board is an inexpensive I2C GPIO Extender Board. It allows you to add 8 pins of GPIO, with interrupts allowed on all pins, to any Arduino or Raspberry Pi design. It works with 5V and 3.3V and in fact you can have 4 pins at 5.0V while having 4 pins at 3.3V at the same time. It is based upon the Semtech SX1502 and it has some really excellent features.  If you need some gates (NAND, XOR, OR, etc., etc.), the SX1502 has a PLD (Programmable Logic Device) mode too!  Here is the block diagram for the board:

features:bd0d61f71bb11e9414848c51131e34cf_original

  • – I2C controlled
  • – 8 GPIO pins
  • – All pins can interrupt the computer
  • – Two bank power supply allows two banks of 4 GPIO pins to have 5V or 3.3V
  • – Can program GPIO pins to make up to 3 pin logic gates (PLD)
  • – Software drivers for Arduino and Raspberry Pi Included!

The Arduino Drivers

c7c6576ccf1f7f6c76d5a8fb0974224d_original
Arduino Uno Test Jig

Arduino Software Drivers are available here at https://github.com/switchdoclabs/SDL_Arduino_SX1502

Here is the code to turn on IO-0.  IO-0 has an on board LED to indicate the state of the pin.
  // blink IO 0 to see LED
  
  sx1502.setDirectionGPIOChannel(SX1502_REG_IO0, SX1502_OUTPUT);  

  byte value;
    
  while (1)
  {
    
    // loop about on IO 0 to see the LED blink
    
    Serial.println("----------------");
    sx1502.writeGPIO(0x01);
    delay(1000);
    Serial.println("++++++++++++++");
    value = sx1502.readGPIO();
    Serial.print("GPIO Value =");
    Serial.println(value, HEX);
    
    sx1502.writeGPIO(0x00);
    delay(1000);

    Serial.println("----------------");
   
    
  }

And the results:

Test SDL_Pi_SX1502 Version 1.0 - SwitchDoc Labs
Sample uses 0x21 I2C Address
Blinks IO0 once every second
Program Started at:2015-08-04 03:45:27
----------------- 
++++++++++++++ 
('GPIO Value =', 1) 
---------------- 
---------------- 
++++++++++++++ 
('GPIO Value =', 1) 
---------------- 
----------------