USB-I2C/SPI/GPIO Adapter - U2C-12

USB-I2C/SPI/GPIO Interface Adapter U2C-12 provides simple solution to control various hardware devices with I2C, SPI, SMBUS and other serial and parallel interfaces and buses from your PC.


SPI Interface Overview
SPI Interface
  • SPI Interface Configuration

    To configure SPI interface open SPI Configuration dialog window in U2C-12 Control Panel application or call U2C_SpiSetConfigEx() function from your software.

    Specification defines 4 different modes for SPI Interface. This modes are configured with Clock Polarity (CPOL) and Clock Phase (CPHA) parameters:

    • Clock Polarity is configured with CPOL parameter. If CPOL=0, clock idle value is 0. If CPOL=1, clock idle value is 1.
    • Clock Phase is configured with CPHA parameter. If CPHA=0 the leading clock edge is used to clock the data bit. If CPHA=1 the trailing edge is used to clock the data bit.

    USB-I2C/SPI Interface Adapter supports SPI interface frequencies from 2 kHz to 200 kHz. The frequency can be configured either from "SPI Configuration" dialog box in Control Panel application, or with U2C_SpiSetFreq() function.

    You can connect up to 20 different SPI slave devices to single USB-I2C/SPI Interface Adapter. Each slave device has Slave Select (SS) pin. Connect the Slave Select pin to any unused USB-I2C/SPI Interface Adapter GPIO pin. Then you can configure U2C-12 SPI interface to use this pin.

    In U2C-12 Control Panel application, select "Slave Select" checkbox in "SPI Configuration" dialog window. In "SS Pin" drop list choose U2C-12 GPIO pin which is connected to your slave device. The "Active High" checkbox is used for Slave Select pin phase configuration.

    To configure Slave Select pin from your software use U2C_SpiConfigSS() function.

  • SPI Interface Data Transfer

    USB-I2C/SPI Interface Adapter can transfer data either in half-duplex or full-duplex modes.

    To transfer data from U2C-12 Control Panel application use SPI Bus bar. Specify the data to be sent by USB-I2C/SPI Interface Adapter in the "Data" field and the data length in the "Length" field. "SPIReadWrite" button executes the full-duplex SPI interface transfer. The data is simultaneously transfered to and from the slave device. "SPIWrite" button sends the data from USB-I2C/SPI Interface Adapter to slave device. "SPIRead" button sends the data from slave device to USB-I2C/SPI Interface Adapter.

    To transfer data from your software use U2C_SpiReadWriteSS(), U2C_SpiWriteSS() and U2C_SpiReadSS() functions.