Ratoc Systems REX-USB61 User manual

USB-SPI/I2C Protocol Emulator
2013.10
Rev. 1.0

REX-USB61 USB-SPI/I2C Protocol Emulator
1- 1
1- 1
1- 3
1- 4
1- 5
1- 6
1- 9
2- 1
2- 1
2- 3
2- 5
2- 6
2- 7
2- 8
3- 1
3- 1
3- 2
3- 8
3-13
3-18
4- 1
4- 1
4- 3
4- 8
4- 9
4-24
4-25
4-27
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 SPI Master Max. frequency 12MHz
I2C Master/Slave Frequency 47KHz~1MHz
Input/Output level [Output] 3.3V/5V
[Input] 1.8V - 5.0V is enabled with external P/S
Dimension 57(W) x 75(D) x 18(H) mm
Weight Approx.60g (except cable)
Operating
Environment
Temperature:5~55℃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 USB61.inf Setting file for REX-USB61
(Windows Vista x32/XP x32/XP x64)
Installer USB61_Setup.exe
Installer for Windows 8 x32/8 x64/
7 x32/7 x64/Vista x64
Utility Usb61Uty.exe Utility to control SPI/I2C
Script file I2C_script.txt
SPI_script.txt
Script file for I2C bus control
Script file for SPI bus control
Sample program
(VC6.0/VB6.0/VB
2005/C#)
EEPROMRWUty
I2cSlaveSample
Sample program to send/receive
SPI/I2C
Sample program for I2C slave
Library
usb61api.dll
usb61def.h
usb61api.bas
usb61api.vb
Library to control SPI/I2C devices
Header file for Visual C
Module for Visual Basic
Code file for Visual Basic
ActiveX control usb61api.ocx ActiveX control for REX-USB61
Uninstall utility USB61_uninst.exe 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
(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)
A
ccess LED (Access : Orange Non-
A
ccess : 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
color Signal Usage
1 Black Brown Power
Input/Output of power supply for a
target device
(Output 5V or 3.3V @100mA)
(Input 1.8V - 5V )
2 Black Red Power
Input/Output of power supply for a
target device
(Output 5V or 3.3V @100mA)
(Input 1.8V - 5V )
3 Black Orange 1MHz - SCL
Clock for I2C
(401KHz - 1MHz bus voltage 5V only)
(Pull-up resistance 10kΩ)
4 Black Yellow 1MHz - SDA
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Ω)
6 Black Blue SDA
Data signal for I2C
(47KHz-400KHz 1.8-5V)
(Pull-up resistance 10kΩ)
7 Black Purple SCK Clock signal for SPI
(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
number Housing color Cable
color Signal Usage
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.
(1-4) Each mode
The below explains master/slave mode on SPI /I2C bus.
Bus Operation
SPI Bus Master mode This mode can select a slave, send data,
display data received from the slave.
Master mode This mode can send data to a particular
address, display data received from the slave.
I2C Bus
Slave mode This mode can display data received to self
-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.
Inside of REX-USB61
Level converter IC
Power
SDO
5Vor3.3V
USB PIC
5V
SDI
DOx
SCK
10KΩ
10KΩ
10KΩ
[ 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.)
A target device
supply power.
Disable output of power
supply of REX-USB61.
REX-USB61
ATMEL:
AT25080A
SI
SO
SCK
#CS
ATMEL:
AT25080A
SI
SO
SCK
#CS
●
SDO
SDI
SCK
DO0
DO1
DO2
DO3
Power
GND
●●
●
●
●
●
●
●
●●
●●
●
●
●
●
Be sure to connect the
power terminal.
Power
Power

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.)
A target device doesn’t
supply power.
REX-USB61 output
power supply.
REX-USB61
Power
ATMEL:
AT25080A
SI
SO
SCK
#CS
ATMEL:
AT25080A
SI
SO
SCK
#CS
●
SDO
SDI
SCK
DO0
DO1
DO2
DO3
GND
●●
●
●
●
●
●
●
●●
●●
●
●
●
●
Be sure to connect the
power terminal.
Power
Power

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.
Inside of REX-USB61
SDA
SCL
10KΩ
10KΩ
Pull up control
5Vor3.3V
10KΩ
10KΩ
5V
Pull up control
Level converter IC
1MHz-SDA
1MHz-SCL
Power
USB PIC
[ 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
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.)
ATMEL:
AT24C02B
SDA
SCL
Power
●
●
ATMEL:
AT24C02B
SDA
SCL
Power
●
●
Power
SDA
SCL
GND
A
ddress
50h
A
ddress
●
●
●
●
REX-USB61
●●
A target device supply
power.
Disable output of power
supply of REX-USB61.
Be sure to connect the
power terminal.
※1
●●
●
●
●
●
●
●
●
●
●
●
51h
*1 The pull-up resistance on REX-USB61 is 10KΩ.
If necessary, add pull-up resistance.

1.Introduction Page.1-11
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.)
ATMEL:
AT24C02B
SDA
SCL
Power
●
●
ATMEL:
AT24C02B
SDA
SCL
●
●
●
●
●
●
●●
●
●
●
●
●
●
●●
●
●
●
●
SDA
SCL
REX-USB61 output
Power
Be sure to connect the
power terminal.power supply
A target device doesn’t
supply power.
※1
A
ddress
50h
GND
Power
REX-USB61
A
ddress
51h
*1 The pull-up resistance on REX-USB61 is 10KΩ.
If necessary, add pull-up resistance.

1.Introduction Page.1-12
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.)
ATMEL:
AT24C02B
SDA
SCL
Power
●
●
ATMEL:
AT24C02B
SDA
SCL
Power
●
●
A
ddress
50h
●
●
●
●
Power
1MHz-SDA
1MHz-SCL
●●
●
●
●
●
●
●
●
●
5V
5V
A target device
supply power.
Disable output of power
supply of REX-USB61.
Be sure to connect the
power terminal.
GND
REX-USB61
A
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
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.)
ATMEL:
AT24C02B
SDA
SCL
Power
●
●
ATMEL:
AT24C02B
SDA
SCL
Power
●
●
●
●
●
●
※1
●●
●
●
Be sure to connect the
power terminal.
power supply
REX-USB61 output
5V
Power
1MHz-SDA
1MHz-SCL
●
5V
●
●●
●
●
●
●
●
●
A target device
supply power.
A
ddress
50h
GND
REX-USB61
A
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.SettinguponWindows 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.SettinguponWindows 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.SettinguponWindows 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.SettinguponWindows 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.SettinguponWindows 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.
Table of contents
Other Ratoc Systems Media Converter manuals

Ratoc Systems
Ratoc Systems USB-Serial Converter REX-USB60F User manual

Ratoc Systems
Ratoc Systems U2SCX-LVD User manual

Ratoc Systems
Ratoc Systems RAL-KEB02iP User manual

Ratoc Systems
Ratoc Systems U2SCXU User manual

Ratoc Systems
Ratoc Systems USB-Serial Converter REX-USB60 User manual

Ratoc Systems
Ratoc Systems RAL-DSDHA2 User manual

Ratoc Systems
Ratoc Systems FR1SX User manual