SC18IS602 I2C to SPI Bridge Module

Overview

This module is designed to serve as an interface between a standard I2C-bus of a microcontroller and an SPI bus. This allows the microcontroller to communicate directly with SPI devices through its I2C-bus. This module operates as an I2C-bus slave-transmitter or slave-receiver and an SPI master. It controls all the SPI bus-specific sequences, protocol, and timing.

This module is useful when there is no SPI interface on the microcontroller or the SPI interface is occupied for something else. Due to the multi-slave characteristics of I2C bus, multiple such modules could be added to the system at the same time.

Features

  • LED indicators for the SCL, and SDA activities
  • 4 extra software programmable GPIOs for IO expansion
  • Up to 1.8MHz SPI Clock
  • 3-pin, 4-pin interlock connectors onboard
  • Arduino IDE compatible library
  • All pins are 5V tolerant (after power supply applied)
  • 5V MOSI, SCK, SS0, SS3 output.
  • Compact size

Pin Configuration

  • VCC: 5V power supply (Power)
  • SCL: I2C Bus Clock (Input)
  • SDA: I2C Bus Data (Open drain)
  • INT: SC18IS602 IRQ (Open drain)
  • MOSI: Master Out Slave In (Push-pull)
  • MISO: Master In Slave Out (Input)
  • SCK: SPI Clock (Push-pull)
  • SS0/GPIO0: Chip select output SS0 or GPIO0
  • SS1/GPIO1: Chip select output SS1 or GPIO1
  • IO2: GPIO2
  • SS3/GPIO3: Chip select output SS3 or GPIO3
  • GND: Common Ground (Power)

I2C Address Selection

The I2C address of the module can be set to any value between 0x50-0x5E (8-bit I2C Address, odd address for reading and even address for writing). The address is set by the three resistors marked by the red box shown in the following picture.

MOD-000021.address_selection

By default all resistors are soldered to “0”, this yields a writing address of 0x50 and a reading address of 0x51.

Install the Library and Run the example sketch

  1. Download the SPIBRIDGE.zip and unzip the file to the Arduino library directory. The Arduino example directory is the folder examples under Arduino program root folder. e.g. C:\Program Files (x86)\Arduino\examples
  2. Start the Arduino IDE.
  3. Select the example sketch from File->Examples->SPIBRIDGE->SELFTEST.
  4. Short the MOSI and MISO pins together.
  5. Upload the sketch.
  6. Both LEDs should flash in 300ms interval.

The library provides a set of SPI communication functions similar to that of the original Arduino SPI library. Basically, a class named SC18IS602 is used instead of the original SPI class.

To use this library, an object should be created by referencing the class SC18IS602.

To initialize the module and choose ss0 as the chip select pin

To send a byte 0x55 and simultaneously receive a byte from SPI

To set gpio0 as an input pin

To set gpio0 as an output pin

To set gpio0 to HIGH

To read from gpio0

Other methods like setBitOrder(), setClockDivider(), setDataMode(), etc., are also supported by the library.

Dimensions

MOD-000021.dimensions

FacebookTwitterGoogle+Share

Leave a Reply

Your email address will not be published. Required fields are marked *


6 − = three