Innodisk EMUI-0D01 User manual

EMUI-0D01
USB to 32bit DIO
User Manual
Rev 1.0

i
2005-2016 © Innodisk Corporation. All Rights Reserved
Copyright Information
2005-2016 © Innodisk Corporation. All Rights Reserved
Innodisk™ is trademark or registered trademark of Innodisk Corporation.
This document is subject to change and revision without notice. No part of this
document may be reproduced in any form by any photographic, electronic,
mechanical or other means, or used in any information storage and retrieval system,
without prior written permission from Innodisk Corporation.
All other product and brand names in this document are trademarks or registered
trademarks of their respective owners.
版權說明
2005-2016 © 宜鼎國際股份有限公司
Innodisk™ 是宜鼎國際股份有限公司之註冊商標。
本文件得不經通知即更改或修訂。本文件中出現任何文字敘述、文件格式、圖形、
照片、方法及過程等內容,除另特別註明,版權均屬宜鼎國際股份有限公司所有,
受到相關之智慧財產權保護法之保障。任何個人、法人或機構未經宜鼎國際股份
有限公司的書面(包括電子文件)授權,不得以任何形式複製或引用本文件之全
部或片段。
其他出現在本文件的品牌或產品乃歸屬原公司所有之商標或註冊。

ii
2005-2016 © Innodisk Corporation. All Rights Reserved
Revision History
Revision
Date
Description
1.0
2016/10/04
Initial Release

iii
2005-2016 © Innodisk Corporation. All Rights Reserved
Table of Contents
Revision History .................................................................................................................................ii
Table of Contents .............................................................................................................................. iii
Introduction .................................................................................................................................11.
Connector Pin Define ...................................................................................................................22.
DB37 Male Connector Pin Define ........................................................................................................2
40DP-1.25 Connector Pin Define .........................................................................................................2
Control Bitmap .............................................................................................................................33.
Windows OS.................................................................................................................................4
4.
4.1. Installation .................................................................................................................................4
4.2. EMUI-0D01 Console Utility for Windows...................................................................................6
4.2.1. Command: OD [n] ...............................................................................................................6
4.2.2. Command: CD .....................................................................................................................6
4.2.3. Command: SC ......................................................................................................................6
4.2.4. Command: SA...................................................................................................................... 7
4.2.5. Command: SV......................................................................................................................7
4.2.6. Command: RE......................................................................................................................7
4.2.7. Command: IO ......................................................................................................................7
4.2.8. Command: EI .......................................................................................................................8
4.2.9. Command: MO EN/DS.........................................................................................................9
4.2.10. Command: CR AL/IT/ER.....................................................................................................10
4.2.11. Command: EC....................................................................................................................10
4.2.12. Command: IC..................................................................................................................... 11
Linux OS 115.
5.1. Installation ...............................................................................................................................11
5.2. EMUI-0D01 Console Utility for Linux .......................................................................................11
Software API ..............................................................................................................................126.
6.1. COM Port Selection..................................................................................................................12
6.2. Function Description................................................................................................................13
6.2.1. EMUIShowVer ...................................................................................................................13
6.2.2. EMUIOpenDevice ..............................................................................................................14
6.2.3. EMUICloseDevice ..............................................................................................................14
6.2.4. EMUIIOConfig....................................................................................................................15
6.2.5. EMUIExIntrConfig..............................................................................................................16
6.2.6. EMUIReset.........................................................................................................................17
6.2.7. EMUIMonitor (call back function) .....................................................................................17

iv
2005-2016 © Innodisk Corporation. All Rights Reserved
6.2.8. EMUIClearEvent ................................................................................................................19
6.2.9. EMUIExpCfg.......................................................................................................................19
6.2.10. EMUIImpCfg ......................................................................................................................20
Contact us........................................................................................................................................ 21

1
2005-2016 © Innodisk Corporation. All Rights Reserved
Introduction1.
Innodisk EMUI-0D01 USB DIO card provides 32bit DIO grouped into four ports: A, B,
C and D. It can connect with either mPCIe slot or USB pin header.
Each port can be configured by software to function as either input or output.
Bit4-Bit7 of Port D can be further configured as external interrupts. EMUI-0D01 saves
port configurations (direction/status/interrupt) into EEPROM automatically and also
can export or import configuration by software.
EMUI VCCIO logic level can be globally configured as 5V or 3.3V via DIP switch . Each
DIO bit is buffered and capable of providing up to 24mA source/sink for 3.3V and
24mA source/sink for 5V.
Features:
−32bit digital I/O in 4 ports (each port 8bit)
−Programmable I/O
−Selectable VCCIO 3.3V or 5V by DIP switch
−Buffered I/O
–(Output 5V, 32mA source, 32mA sink)
–(Output 3.3V, 24mA source, 24mA sink)
−4 external interrupt with rising/falling edge on port D
−Keeps configuration after hardware reboot
−Supports 3rd mounting hole and USB Pin header for out-of-minicard
installation
−Complies with EN61000-4-2 (ESD) Air-15kV, Contact-8kV
−Industrial temperature(-40 ºC to 85 ºC) operation
−30μ ” golden finger, 3 years warranty
−Industrial design, manufactured in Innodisk Taiwan
Factory default setting
VCCIO Logic Level
5V
It can be set to 3.3V by hardware DIP switch
Port Direction
Input
Port Status
Pull-low with 10kΩresistor.
External interrupt
Disable
Interrupt Edge
Rising

2
2005-2016 © Innodisk Corporation. All Rights Reserved
Connector Pin Define2.
DB37 Male Connector Pin Define
Signal
Pin
Pin
Signal
GND
20
1
GND
PA0
21
2
GND
PA1
22
3
PD0
PA2
23
4
PD1
PA3
24
5
PD2
PA4
25
6
PD3
PA5
26
7
PD4
PA6
27
8
PD5
PA7
28
9
PD6
PB0
29
10
PD7
PB1
30
11
PC0
PB2
31
12
PC1
PB3
32
13
PC2
PB4
33
14
PC3
PB5
34
15
PC4
PB6
35
16
PC5
PB7
36
17
PC6
GND
37
18
PC7
19
GND
40DP-1.25 Connector Pin Define
Signal
Pin
Pin
Signal
GND
1
2
GND
PC7
3
4
PB7
PC6
5
6
PB6
PC5
7
8
PB5
PC4
9
10
PB4
PC3
11
12
PB3
PC2
13
14
PB2
PC1
15
16
PB1
PC0
17
18
PB0
PD7/INT3
19
20
PB7

3
2005-2016 © Innodisk Corporation. All Rights Reserved
PD6/INT2
21
22
PA6
PD5/INT1
23
24
PA5
PD4/INT0
25
26
PA4
PD3
27
28
PA3
PD2
29
30
PA2
PD1
31
32
PA1
PD0
33
34
PA0
GND
35
36
GND
GND
37
38
GND
+3.3V(Reserve)
39
40
+3.3V(Reserve)
Control Bitmap3.
DIO Port Status Control
Bit 7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
Px7
Px6
Px5
Px4
Px3
Px2
Px1
Px0
x=A, B, C, D
Bit[7:0] 0=Pull-down (Low), 1=Pull-up (High)
Example:
Port A[7:0] status 0xFF=1111 1111, 0x55=0101 0101, 0xAA=1010 1010
External Interrupt Control
Bit 7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
INT3
Status
INT2
Status
INT1
Status
INT0
Status
INT3
Edge
INT2
Edge
INT1
Edge
INT0
Edge
Bit[7:4] 0=Disable, 1=Enable
Bit[0:3] 0=Falling Edge, 1=Rising Edge
Example:
0x11=0001 0001 means that INT0 is enabled and set as raising edge.
0x10=0001 0000 means that INT0 is enabled and set as falling edge.
0x66=0110 0110 means that INT1 and INT2 are enabled and both set as raising edge.
0x60=0110 0000 means that INT1 and INT2 are both enabled and set as falling edge

4
2005-2016 © Innodisk Corporation. All Rights Reserved
Windows OS4.
4.1. Installation
Step1.
Install EMUI-0D01 either with mPCIe slot or USB pin header. The device named
“innodisk USB DIO” can be found in “Device Manager”.
Click “Update Driver Software” to install driver.
Step2.
Select “Browse my computer for driver software”

5
2005-2016 © Innodisk Corporation. All Rights Reserved
Step3.
Browse the path linking to EMUI-0D01 driver.
Step4.
After installing driver, device can be recognized as a COM port by Windows CDC-ACM
inbox driver (Compaq USB Modem Driver).

6
2005-2016 © Innodisk Corporation. All Rights Reserved
4.2. EMUI-0D01 Console Utility for Windows
You can use this console utility to test EMUI-0D01 in Windows.
Please refer to Section 3 Control Bitmap used in this utility.
Every function in this utility we provide C code API library for programming.
Command: OD [n]4.2.1.
Description: Open virtual COM n port (n=real COM port number)
Example: Open COM 7
Command: CD4.2.2.
Description: Close virtual COM n port (n=real COM port number)
Example: Close an opened COM 7
Command: SC4.2.3.
Description: Show all available COM ports in OS
Example:

7
2005-2016 © Innodisk Corporation. All Rights Reserved
Command: SA4.2.4.
Description: Show directions and status of all 4 ports
Example:
Command: SV4.2.5.
Description: Show FW version and API version
Example:
Command: RE4.2.6.
Description: Reset to factory default setting
Example:
Command: IO4.2.7.
Description: Set or Get digital I/O direction and status
Example: Set Port A direction to output, 8bit status to 0xff (all pull-up)

8
2005-2016 © Innodisk Corporation. All Rights Reserved
Example: Set Port A status to 0x55
Example: Read Port A direction and status
Example: Read Port A status
Note: Input port cannot set status. Its status must be given by external output port.
Command: EI4.2.8.
Description: Set or Get external interrupt configuration of Port D Bit4-Bit7
Example: Enable INT0 (Bit4 of Port D) and set it to rising edge.

9
2005-2016 © Innodisk Corporation. All Rights Reserved
Example: Get external interrupt configuration
Example: Enable all external interrupt and set it to falling edge.
Note: When enabling external interrupt, Port D will be set to input automatically, and
bit0-bit3 only can be input as well.
Command: MO EN/DS4.2.9.
Description: Enable/Disable monitoring of below events
1. Input status change: Send eventonce immediately.
2. Interrupt: Send event immediately when triggered, then continue sending event
every 2 sec.
3. EEPROM Error: Send event every 5 sec after the module power-on. If you clear
this event, it will not send event anymore until next power-on.
Example:
Example: Status change occurs

10
2005-2016 © Innodisk Corporation. All Rights Reserved
Example: Interrupt occurs on INT0 and INT1
Example: Interrupt occurs on all INT port (INT0-INT3)
Example: EEPROM error occurs
Command: CR AL/IT/ER4.2.10.
Description: Clear interrupt or EEPROM error events
You can clear persistent interrupt events or EEPROM error events.
AL=all event, IT=interrupt event, ER=EEPROM error
Example: Clear all events
Command: EC4.2.11.
Description: Export configuration
Example:

11
2005-2016 © Innodisk Corporation. All Rights Reserved
Command: IC
4.2.12.
Description: Import configuration
Example:
Linux OS5.
5.1. Installation
Install EMUI-0D01 either with mPCIe slot or USB pin header. The device will be
recognized as ttyACM% (%=0, 1…) by using native CDC-ACM driver.
Type command “dmesg”to see messages below.
Generally the name would be ttyACM0 or ttyACM1 in Linux.
5.2. EMUI-0D01 Console Utility for Linux
You can use this console utility to test EMUI-0D01 in Linux.
Please refer to Section 3 Control Bitmap used in this utility.
Every function in this utility we provide C code API library for programming.
Linux console utility is almost the same as Windows version.
The only difference is that serial port name is ttyACM instead of COM.
You can use “SC” command to check the index of available serial ports and open it to
use EMUI-0D01.

12
2005-2016 © Innodisk Corporation. All Rights Reserved
Example: The index of ttyACM0 is 24 in EMUI API.
Software API6.
EMUI API is based on a dynamic library (DLL) in Windows and static library (.a) in
Linux to control EMUI-0D01.
lib_emui.h includes declaration and data structure requested for programming.
Windows API must come with libwinpthread-1.dll to use for the monitor function.
6.1. COM Port Selection
EMUI-0D01 is connected by virtual COM port using CDC-ACM driver.
COM port parameter of API must be given an “int”value instead of a real port name
or port number in the OS.
Windows
Real COM port number-1 would be the “int”value for API.
Example: 0=COM1, 1=COM2, 2=COM3…254=COM255, 255=COM256
Linux
EMUI-0D01 supports the following COM names. The names map “int”value start
from 0. Generally the name would be ttyACM0 or ttyACM1 in Linux.
Example: 24=ttyACM0, 25=ttyACM1

13
2005-2016 © Innodisk Corporation. All Rights Reserved
Index
Port
Index
Port
Index
Port
0
ttyS0
1
ttyS1
2
ttyS2
3
ttyS3
4
ttyS4
5
ttyS5
6
ttyS6
7
ttyS7
8
ttyS8
9
ttyS9
10
ttyS10
11
ttyS11
12
ttyS12
13
ttyS13
14
ttyS14
15
ttyS15
16
ttyUSB0
17
ttyUSB1
18
ttyUSB2
19
ttyUSB3
20
ttyUSB4
21
ttyUSB5
22
ttyAMA0
23
ttyAMA1
24
ttyACM0
25
ttyACM1
26
rfcomm0
27
rfcomm1
28
ircomm0
29
Ircomm1
30
cuau0
31
Cuau1
32
Cuau2
33
cuau3
34
cuaU0
35
cuaU1
36
cuaU2
37
cuaU3
6.2. Function Description
This chapter describes API functions and parameters.
EMUIShowVer6.2.1.
Description: Get firmware and library version.
SYSTAX:
int EMUIShowVer(VER_INFO *ver_info)
VER_INFO Struct:
typedef struct
{
int com_port;
char fw [VER_LEN];
char api[VER_LEN];
} VER_INFO;
Member:
com_port: [input] The virtual COM port number
fw: [output] Firmware version
api: [output] API version

14
2005-2016 © Innodisk Corporation. All Rights Reserved
Return Code:
Value
Description
0
Success
1
Fail
EMUIOpenDevice6.2.2.
Description: Open virtual COM port.
SYSTAX:
Int EMUIOpenDevice(int com_port)
Member:
com_port: [input] The virtual COM port number
Return Code:
Value
Description
0
Success
1
Out of range --> com_port > 255
2 (Windows only)
COM port does not exist
5 (Windows only)
COM port was already used
6
Non EMUI DIO
7
EMUI DIO was already opened
EMUICloseDevice6.2.3.
Description: Close virtual COM port.
SYSTAX:
int EMUIOpenDevice(int com_port)
Member:
com_port: [input] The virtual COM port number
Return Code:
Value
Description
0
Success
1
COM port was not opened / Non EMUI DIO

15
2005-2016 © Innodisk Corporation. All Rights Reserved
EMUIIOConfig
6.2.4.
Description: Set/Get digital I/O direction and status.
SYSTAX:
Int EMUIIOConfig (IO_INFO *io_info)
IO_INFO Struct:
typedef struct
{
/* Set & Get config */
int com_port;
int dio_port;
int mode;
/* Set config */
int dir_set;
unsigned char sts_set;
/* Get return info */
GET_RTN get_io_rtn;
} IO_INFO;
Member:
com_port: [input] The virtual COM port number
dio_port: [input] PortA=1, PortB=2, PortC=3, PortD=4
mode: [input] Set_Direction =1, Get_Direction=2, Set_Status=3, Get_Status=4
dir_set: [input] output=0, input=1
sts_set: [input] Low=0, High=1, don’t care when direction=1(input)
get_io_rtn: [output] use in mode 2 and mode 4 “get”functions, return dio_port,
direction, status
typedef struct
{
/* IO config */
int dio_port;
int direction;
unsigned char status;
/* External interrupt */
Table of contents
Popular I/O System manuals by other brands

National Instruments
National Instruments 9224 CALIBRATION PROCEDURE

M-system
M-system R7M-CT4E-R instruction manual

ADLINK Technology
ADLINK Technology pci-6308 user guide

Bpt
Bpt OH/6I installation instructions

M-system
M-system EtherCAT R7I4DECT-1-YVF4 instruction manual

Unitronics
Unitronics V200-18-E1B instructions