Ratoc Systems REX-USB61 User Manual

USB-SPI/I2C Protocol Emulator
2013.10
Rev. 1.0
REX-USB61 USB-SPI/I2C Protocol Emulator
1. Introduction --------------------------------------------­(1-1) Specifications of the product (1-2) Package contents (1-3) Cable specifications (1-4) Each mode (1-5) Connection of a SPI device (1-6)Connection of a I2C device
2. Setting up on Windows (2-1) Setup on Windows 8 x32/8 x64/7 x32/7 x64/Vista x64 (2-2) Setting up on Windows Vista x32 (2-3) Setting up on Windows XP x32/XP x64 (2-4) Confirmation of setting REX-USB61 (2-5)
Uninstallation on Windows 8 x32/8 x64/7 x32/7 x64/Vista x64
(2-6) Uninstallation on Windows Vista x32/XP x32/XP x64
3. SPI/I2C Control Utility (3-1) Functions of the Utility (3-2) Explanation of the Utility (3-3) Example to control by using this utility (3-4) Grammar for script description (3-5) Example of script
4. API Function reference (4-1) Using on VC (4-2) Using on VB / Visual C# (4-3) List of API functions (4-4) Detail of API functions (4-5) Error Codes (4-6) Sample applications (4-7) How to develop application using this API functions
---------------------------------------
---------------------------------------
---------------------------------------
1.Introduction Page.1-1

(1-1) Specifications of the product

REX-USB61 enables you to easily control from a PC a variety of devices with SPI/I2C bus.
[This product comes with SPI/I2C control utility]
This bundled utility can control SPI/I2C, GPO(General Purpose Output) and save a setting file or log file. For further information, please refer to Chapter 3.
[This product also comes with API library and sample program]
Making an application software with the API library enables you to control the following:
Can provide a power supply of 3.3V or 5.0V([N.B.] current is under
100mA) from this product to an external device.
Can provide from 1.8V to 5.0V an input/output level of SPI/I2C/slave
port/parallel out port as long as a power supply terminal of this product is provided by a external voltage.
Can change SPI/I2C, master/slave(SPI is a master only) Can specify a frequency of SPI/I2C bus. Can output a digital of 4bit at I2C mode.
And this product comes with program source codes by which you can use API library.
(For further information on functions, please refer to (4-4) at Chapter 4.
Further information on applications, please refer to (4-6) at Chapter 4.)
[The latest firmware is available through our website] You can update firmware in order to add or change specifications on this products. The latest firmware and update program is available through our website.
1.Introduction Page.1-2
Hardware specifications
Item Specifications
Host Interface USB2.0 Full Speed Device Connector USB mini B connector Voltage 5V (via USB bus power) Consumption Current 100mA
Device Interface
Input/Output level
Dimension 57(W) x 75(D) x 18(H) mm Weight Approx.60g (except cable) Operating Environment
SPI Master Max. frequency 12MHz I2C Master/Slave Frequency 47KHz~1MHz
[Output] 3.3V/5V [Input] 1.8V - 5.0V is enabled with external P/S
Temperature:555℃ Humidity:20~80% (non condensing)
Support Operating System
Windows 8/7/Vista/XP * Works both 32bit OS and 64bit OS
Software
Item File Description
Setting file
for installation
Installer USB61_Setup.exe
USB61.inf
Setting file for REX-USB61
(Windows Vista x32/XP x32/XP x64)
Installer for Windows 8 x32/8 x64/
7 x32/7 x64/Vista x64
Utility Usb61Uty.exe Utility to control SPI/I2C
Script file
Sample program (VC6.0/VB6.0/VB 2005/C#)
Library
ActiveX control usb61api.ocx ActiveX control for REX-USB61
Uninstall utility USB61_uninst.exe
I2C_script.txt SPI_script.txt EEPROMRWUty
I2cSlaveSample usb61api.dll usb61def.h usb61api.bas usb61api.vb
Script file for I2C bus control Script file for SPI bus control Sample program to send/receive SPI/I2C Sample program for I2C slave Library to control SPI/I2C devices Header file for Visual C Module for Visual Basic Code file for Visual Basic
Utility to delete INF file (Windows XP x32/XP x64)
* REX-USB61 can only use 1 device.
On the other hand, REX-USB61M can use multiple devices.
1.Introduction Page.1-3
A

(1-2) Package contents

REX-USB61 package includes:
REX-USB61
CD-ROM USB A – mini B cable SPI/I2C cable
Warranty Card
SPI/I2C cable (For specifications, please see a next page)
USB mini B(Female) connector
Power LED (Power On : Green Power Off : Off)
ccess LED (Access : Orange Non-Access : Off)
1.Introduction Page.1-4

(1-3) Cable Specifications

The below explains the specifications of the cable bundled with REX-USB61.
Pin
number
Housing
color
Cable
Signal Usage
color
1 Black Brown Power
2 Black Red Power
3 Black Orange 1MHz - SCL
4 Black Yellow 1MHz - SDA
Input/Output of power supply for a target device (Output 5V or 3.3V @100mA) (Input 1.8V - 5V ) Input/Output of power supply for a target device (Output 5V or 3.3V @100mA) (Input 1.8V - 5V ) Clock for I2C (401KHz - 1MHz bus voltage 5V only) (Pull-up resistance 10kΩ) Data signal for I2C (401KHz - 1MHz bus voltage 5V only) (Pull-up resistance 10kΩ)
5 Black Green SCL
Clock for I2C (47KHz-400KHz 1.8-5V) (Pull-up resistance 10kΩ) Data signal for I2C
6 Black Blue SDA
(47KHz-400KHz 1.8-5V) (Pull-up resistance 10kΩ) Clock signal for SPI
7 Black Purple SCK
(12MHz 1.8 - 5V) 8 Black Gray SDO Data out signal SPI (12MHz 1.8 - 5V) 9 Black White SDI Data in signal SPI (12MHz 1.8 - 5V)
10 Black Black Reserve N/A(Don’t use)
* Don’t use I2C 401KHz-1MHz(Pin#3,4) and SPI(Pin#7,8,9) at the same time.
1.Introduction Page.1-5
Pin
Housing color
number
11 White(Gray) Gray GND Ground 12 White(Gray) Red GND Ground 13 White(Gray) Orange DO0 SS0 for SPI/PORT0 for I2C (1.8 - 5V) 14 White(Gray) Yellow DO1 SS1 for SPI/PORT1 for I2C (1.8 - 5V) 15 White(Gray) Green DO2 SS2 for SPI/PORT2 for I2C (1.8 - 5V) 16 White(Gray) Blue DO3 SS3 for SPI/PORT3 for I2C (1.8 - 5V) 17 White(Gray) Purple GND Ground 18 White(Gray) Gray GND Ground 19 White(Gray) White N.C. N.C. 20 White(Gray) Black N.C. N.C.
Cable
Signal Usage
color

(1-4) Each mode

The below explains master/slave mode on SPI /I2C bus.
Bus Operation
This mode can select a slave, send data,
SPI Bus Master mode
display data received from the slave. This mode can send data to a particular
Master mode
address, display data received from the slave.
I2C Bus
This mode can display data received to self
Slave mode
-address, send data to master. You can select master mode or slave mode of REX-USB61 by the bundled utility software or API library.
1.Introduction Page.1-6

(1-5) Connection of a SPI device

The below explains how to connect an EEPROM with SPI interface.
Regarding power supply of REX-USB61
In order to provide power supply to a level converter IC on the
REX-USB61, it is required to connect the power pin of the REX-USB61 to a power supply of a target device, even if the target device doesn’t have power supply.
5V
USB PIC
Inside of REX-USB61
5Vor3.3V
Level converter IC
Power
10K
10K
10K
SDO
SDI
SCK
DOx
[ Caution ]
When connecting/disconnecting a device, never provide power to REX-USB61 nor the device. (If you provide power to REX-USB61 or the device and connect
or disconnect the device, REX-USB61 will be broken.)
1.Introduction Page.1-7

SPI Connection( If a target device has power supply)

If a target device has power supply, please disable power supply by utility software or application which uses an API library. ( The library is called usb61_power_control(). Refer to (4-4) at Chapter 4.)
Disable output of power
supply of REX-USB61.
Power
● ● ●
SDO
SDI
SCK
DO0
DO1
DO2 DO3
GND
REX-USB61
Be sure to connect the
power terminal.
A target device
supply power.
Power
SI
SO
SCK
#CS
SI
SO
SCK
ATMEL:
AT25080A
Power
ATMEL:
AT25080A
#CS
1.Introduction Page.1-8

SPI Connection( If a target device doesn’t have power supply)

If REX-USB61 supply power(3.3V/5.0V) to a target device, please use utility
software or application which uses an API library.
( The library is called usb61_power_control(). Refer to (4-4) at Chapter 4.)
REX-USB61 output
power supply.
Be sure to connect the
power terminal.
A target device doesn’t
supply power.
REX-USB61
Power
SDO
SDI
SCK DO0
DO1
DO2 DO3
GND
Power
SI
SO
SCK
ATMEL:
AT25080A
#CS
Power
SI
SO
SCK
ATMEL:
AT25080A
#CS
1.Introduction Page.1-9

(1-6) Connection of a I2C device

The below explains how to connect an EEPROM with I2C interface.
Regarding power supply of REX-USB61
In order to provide power supply to a level converter IC on the
REX-USB61, it is required to connect the power pin of the REX-USB61 to a
power supply of a target device, even if the target device doesn’t have power
supply.
5V
USB PIC
5Vor3.3V
Inside of REX-USB61
Pull up control
10K
10K
Level converter IC
Pull up control
10K
10K
1MHz-SDA
Power
SDA
SCL
1MHz-SCL
[ Caution ]
When connecting/disconnecting a device, never provide power to REX-USB61 nor the device. (If you provide power to REX-USB61 or the device and connect
or disconnect the device, REX-USB61 will be broken.)
1.Introduction Page.1-10
A
A

I2C connection( If a target device has power supply)

If a target device has power supply, please disable power supply by utility software or application which uses an API library.
( The library is called usb61_power_control(). Refer to (4-4) at Chapter 4.)
Disable output of power
supply of REX-USB61.
Be sure to connect the
power terminal.
A target device supply
power.
Power
SDA
SCL
※1
SDA
SCL
ATMEL:
AT24C02B
Power
ddress
50h
GND
REX-USB61
SDA
SCL
*1 The pull-up resistance on REX-USB61 is 10KΩ.
If necessary, add pull-up resistance.
Power
ATMEL:
AT24C02B
ddress
51h
1.Introduction Page.1-11
A
A

I2C connection( If a target device doesn’t power supply)

If REX-USB61 supply power(3.3V/5.0V) to a target device, please use utility
software or application which uses an API library.
( The library is called usb61_power_control(). Refer to (4-4) at Chapter 4.)
REX-USB61 output
Be sure to connect the
power terminal. power supply
A target device doesn’t
supply power.
Power
SDA
SCL
SDA
SCL
ATMEL:
AT24C02B
※1
Power
ddress
50h
GND
REX-USB61
*1 The pull-up resistance on REX-USB61 is 10KΩ. If necessary, add pull-up resistance.
SDA
SCL
Power
ATMEL:
AT24C02B
ddress
51h
1.Introduction Page.1-12
A
A

I2C connection [1MHz-SCL / 1MHz-SDA] ( If a target device has power supply)

If a target device has power supply, please disable power supply by utility software or application which uses an API library.
( The library is called usb61_power_control(). Refer to (4-4) at Chapter 4.)
Disable output of power
supply of REX-USB61.
5V
5V
● ●
1MHz-SDA 1MHz-SCL
REX-USB61
Power
GND
Be sure to connect the
power terminal.
SDA
SCL
SDA
SCL
A target device
supply power.
Power
ATMEL:
AT24C02B
Power
ATMEL:
AT24C02B
ddress
50h
ddress
51h
* Only after providing power to all devices, set on pull-up resistance.
* If a target device provide power, don’t attach pull-up resistance on I2C bus.
1.Introduction Page.1-13
A
A

I2C connection [1MHz-SCL / 1MHz-SDA] ( If a target device doesn’t have power supply)

If REX-USB61 supply power(5.0V) to a target device, please use utility
software or application which uses an API library.
( The library is called usb61_power_control(). Refer to (4-4) at Chapter 4.)
REX-USB61 output
power supply
Be sure to connect the
power terminal.
A target device
supply power.
5V
5V
● ●
Power
1MHz-SDA 1MHz-SCL
※1
SDA
SCL
ATMEL:
AT24C02B
Power
ddress
50h
GND
REX-USB61
SDA
SCL
ATMEL:
AT24C02B
Power
ddress
51h
* Only after providing power to all devices, set on pull-up resistance.
*1 The pull-up resistance on REX-USB61 is 10KΩ. If necessary, add pull-up resistance.
2.Setting up on Windows Page.2-1

(2-1) Set up on Windows 8 x32/8 x64/7 x32/7 x64/Vista x64

Turn on the PC and proceed to the below installation before connecting REX-USB61 to the USB port.
Start Win8_7_VistaX64¥USB61_ Setup.exe at the bundled CD-ROM. If user account window appear, click [Yes].
RATOC REX-USB61 Installer will start. Click [Next].
Click [Install].
2.Setting up on Windows Page.2-2
Click [Install] on the Windows Security window.
The set up has finished.
If REX-USB61 is connected to the PC, the installation will automatically finish.
Proceed to (2-4) Confirmation of setting REX- USB61 to confirm the installation has finished properly.
2.Setting up on Windows Page.2-3

(2-2) Setting up on Windows Vista x32

Turn on the PC and connect REX-USB61 to the USB port.
The below hardware wizard will start up. Proceed to the below instruction.
Select [Locate and install driver software (recommended)].
If user account window appear, click [Yes].
Click [Don’t search online], as shown right.
2.Setting up on Windows Page.2-4
Insert the bundled CD-ROM and click [Next].
Select [Install this driver software anyway].
The installation of REX-USB61 has finished.
Proceed to (2-4) Confirmation of setting REX- USB61 to confirm the installation has finished properly.
2.Setting up on Windows Page.2-5

(2-3) Setting up on Windows XP x32/XP x64

Turn on the PC and connect REX-USB61 to the USB port.
The below hardware wizard will start up. Proceed to the below instruction.
Select [No, not this time] and click [Next].
Insert the bundled CD-ROM and select [Install the software automatically(Recommended)] and click [Next].
The installation of REX-USB61 has finished.
Proceed to (2-4) Confirmation of setting REX- USB61 to confirm the installation has finished properly.
2.Setting up on Windows Page.2-6

(2-4) Confirmation of setting REX- USB61

Open [Device Manager].
( On Windows XP x32/XP x64, open [Control Panel] and [System]. And select the [Hardware] tab and click the [Device manager] button.)
Confirm there is a string of [RATOC REX-USB61] properly under the [SPI/I2C Converter Device].
2.Setting up on Windows Page.2-7
(2-5)
Start [Programs and Functions].
Select [RATOC REX-USB61 Installer] and click [Uninstall].
Click [Yes].
Uninstallation on Windows 8 x32/8 x64/7 x32/7 x64/Vista x64
The uninstallation of REX-USB61 has finished.
2.Setting up on Windows Page.2-8

(2-6) Uninstallation on Windows Vista x32/XP x32/XP x64

To uninstall REX-USB61, you have to delete the driver and INF file.
(On Windows Vista, you have to delete the driver only.)
Delete the driver
Open [Device Manager].
( On Windows XPx32/XPx64, open [Control Panel] and [System]. And select the [Hardware] tab and click the [Device manager] button.)
Right-click the [RATOC REX-USB61] and select [Uninstall].
On Windows Vista x32, put the check mark, as shown right and click [OK].
Loading...
+ 52 hidden pages