------------------------------------Written by Martin Hsu
Edited by Cindy Huang
Warranty
Warning
All products manufactured by ICP DAS are under warranty regarding
defective materials for a period of one year, beginning from the date of
delivery to the original purchaser.
ICP DAS assumes no liability for any damage resulting from the use of this
product. ICP DAS reserves the right to change this manual at any time
without notice. The information furnished by ICP DAS is believed to be
accurate and reliable. However, no responsibility is assumed by ICP DAS for
its use, not for any infringements of patents or other rights of third parties
resulting from its use.
Copyright
Copyright @ 2012 by ICP DAS Co., Ltd. All rights are reserved.
Trademark
The names used for identification only may be registered trademarks of
their respective companies.
Contact US
If you have any problem, please feel free to contact us.
You can count on us for quick response.
Email: service@icpdas.com
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 2
Table of Contents
Table of Contents ................................................................................................................ 3
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 4
1. Introduction
PWM (Pulse width modulation) is a powerful technique for controlling analog circuits. It uses
digital outputs to generate a waveform with variant duty cycle and frequency to control
analog circuits. I-8088W has 8 PWM output channels and 8 digital inputs. It can be used to
develop powerful and cost effective analog control system.
Features:
Automatic generation of PWM outputs by hardware, without software intervention.
10 Hz ~ 500 kHz (non-continuous) PWM output frequency with 0.1% ~ 99.9% duty cycle
Software and hardware trigger mode for PWM output
Individual and synchronous PWM output Using software trigger mode, you can set
configuration for all PWM channels then trigger them one by one or all of them at the
same time.
Burst mode PWM operation for standby
DI channel can be configured as simple digital input channel or hardware trigger source
of the PWM output.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 5
1.1. Specification
PWM Output
Channels
8
Scaling Resolution
16-bit (1 ~ 128 µs for each step)
Frequency Range
10 Hz ~ 500 kHz (non-continuous)
Duty Cycle
0.1 % ~ 99.9 %
PWM Mode
Burst counting, Continuous mode
Burst Counter
1 ~ 65535
Hardware Trigger Mode
Trigger Start and Trigger Stop
Output Type
Source
Max. Load Current
1 mA
Intra-module Isolation, Field to Logic
3,750 Vrms
ESD Protection
4 kV Contact for each channel
Digital Input
Input Channels
8 (Sink/Source)
Input Type
One common for all digital input
On Voltage Level
+5 V ~ +30 V
Off Voltage Level
< 0.8 V
Input Impedance
4.7 kΩ, 1/4 W
Intra-module Isolation, Field to Logic
3,750 Vrms
ESD Protection
4 kV Contact for each channel
LED Display
1 LED as Power Indicator/16 LED as PWM and Digital Input Indicator
Power
Power Consumption
40 mA @ 5 V, 2 W ± 5 %
Environment
Operating Temperature
-25 °C ~ +75 °C
Storage Temperature
-30 °C ~ +85 °C
Humidity
5 % ~ 95 % RH, non-condensing
Dimensions
30 mm x 102 mm x 115 mm (W x L x H)
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 6
1.2. Pin Assignment
Pin 01 ~ 08: PWM0 ~ PWM7, are designed for PWM output
Pin 09 ~ 10: PWM.GND is isolated ground.
Pin 11 ~ 18: DI0 ~ DI7 are designed for digital input that also capable of setting as an
external trigger signal to start or stop its PWM pulse.
Pin 19 ~ 20: DI.COM is isolated ground.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 7
1.3. Block Diagram
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 8
1.4. Wire Connection
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 9
In this section, we will introduce you one simple program (demo 8080W.exe) which have
three setup modes – Normal, Hardware Trigger and Synchronize. We need to check the
following steps before running the program.
1. First, user need to download LinPAC SDK,
which is includes GNU toolchain, Libraries,
header, examples files, etc.
2. Check the power cable, Ethernet cable, VGA
monitor, the communication cable between
controller and PC has been connected well,
and then check the i-8088W has been plugged
in the controller.
3. Next, check the communication between
controller and PC is fine, and download the
demo program files to the controller.
4. User can find the related files in the product CD or below website:
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 10
Note: Each time you change the settings of “PWM Duty", you have to re-send the
“Start PWM” command to ensure the operation properly.
2.2.1. Flow Chart
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 11
2.2.2. How to Setup the Standard PWM
Please make sure you have completed the steps in section 2.1 before operating the
following steps.
Description of the demo:
In this example, we will use the demo to set I-8088W as “Continuous” mode and its
frequency is 10 Hz, PWM duty is 50%. When we send the “Start Normal PWM” commend,
the DI0 will blinking per 0.5s.
Wire connection of I-8088W:
To do this, you need to wire PW0 to DI0, DI.COM to External 5V, PWM.GND to External
GND. (Please refer to section 1.2 Pin Assignment)
Now, follow the steps to configure the related parameter:
Step 1: Change the authority of “demo8088W.exe”
For example, my LP-8x4x’s IP address is 10.1.0.39, and telnet to the LP-8x4x by pietty.exe
as below:
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 12
Step 2: Change the authority of “demo8088W.exe”
When you run the program, it will initialize the i-8088W module and obtain the related
information as shown below.
Step3: Set PWM Mode
This setting includes two modes – “Burst Count Mode” and “Continuous Mode”.
“Burst Count Mode” means it can output multiple fixed pulse in a period time and then stop
output. “Continuous Mode” means it can output one fixed pulse in a period time and continue
output.
In this example, we enter "1" to set it as "Continuous mode".
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 13
Step 4: Set PWM Duty
There are three options in this setting, if you choose:
"0" means you can enter an integer value (ex. input 50 to set it as 50 %)
"1" means you can enter an integer value to set it as one decimal place value. (ex. input
999 to set it as 99.9 %)
"2" means you can enter a one decimal place value. (ex. input 99.9 to set it as 99.9 %)
In this example, please enter "0" to set it as “Normal integer Duty”
Then, we will set its frequency as 10 Hz, PWM duty as 50 %.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 14
Step 5: Start PWM
You will see three modes in below picture, please enter “0” to set it as “Normal PWM”
Then enter “0” to start the PWM.
If you have completed the correct setup, you will see below picture. In this example, it will
send the “start PWM“ command to channel 0 ~ 7, the condition is 10 Hz with 50% duty, and
we has connected the PWM0 to DI0, so the DI0 will blink per 0.5 seconds.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 15
2.3. Using DI to Trigger PWM
Set PWM Mode
Set Burst Count
Choice Burst Count Mode (1~65535)
Set PWM Duty
Set Integer DutySet x10 Integer Duty
Input Frequency
Input Duty
Configure DI as external trigger source for each channel
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 16
2.3.2. How to Setup the Trigger PWM
There are 8 DI pins on I-8088W, normally these DI pin just acts as digital input channels. We
can also configure them as external trigger signal pins to start or stop the PWM output.
Step 1: Follow the same way in section 2.2.2 to configure PWM output mode and set
PWM duty and frequency.
Step 2: Enter “1” to set “Hardware Trigger PWM”
There are three options to set the DI channels as PWM trigger signal:
“0”: Normal DI. If you set it as "Normal DI" mode, it will be unrelated to the PWM
function.
“1”: Accept DI signal to start the PWM output.
“2”: Accept DI signal to stop the PWM output.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 17
There are two ways to configure the DI signal to start or stop the PWM output. One is rising
“Rising edge” to trigger
the PWM to START.
“Rising edge” to trigger
the PWM to STOP.
edge to trigger the PWM to start or stop, the wiring like below two pictures.
Rising edge to Start PWM
Rising edge to Stop PWM
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 18
“Falling edge” to
trigger the PWM to
START.
“Falling edge” to trigger
the PWM to STOP.
The other is falling edge to trigger the PWM to start or stop, the wiring like below two
pictures.
Falling edge to Start PWM
Falling edge to Stop PWM
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 19
Step 3: Start the PWM
You can enter “1” to start the PWM output. It will start PWM when received an external
trigger signal.
Step 4: Stop the PWM:
In Normal PWM mode, the signal will continue transfer until you go back to enter “2” to stop
the PWM output.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 20
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 21
2.4.2. How to Setup the Standard PWM
I-8088W can configure each PWM output channel as synchronous mode.
Step 1: Follow the same way in section 2.2.2 to configure PWM output mode and set
PWM duty and frequency.
Step 2: Enter “2” to set “Synchronous PWM”
Step 3: Enter“1” to enable
Step 4: Enter“1” to start Synchronous PWM.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 22
You will see the different between following two pictures.
Non-synchronous
Synchronous
Start PWM:
In previous sections, we can start PWM by software command or DI trigger signal, but you
can see the signal is non-synchronous in below picture.
Start Synchronous PWM:
So, we can call i8088W_Sync_Start or pac_i8088W_Sync_Start to start the PWM output
and synchronize the rising edge for each synchronous PWM pulse.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 23
3. API for Linux PAC
3.1.1. i8088W_Init
The function can initialize the I-8088W and then check the hardware ID for each slot. If the return
value is “0” that means there is an I-8088W module in that slot. If return “-1” that means there is
no I-8088W module.
Syntax
short i8088W_Init(int slot);
Parameters
slot: 1 ~ 8
Return Value
Please refer to Error Code Table.
Example
[C]
int slotIndex, err;
err=i8088W_Init(slotIndex);
Open_Slot(slotIndex);
if(err==0)
printf(“There is an I-8088W at slot %d\n”,slotIndex);
else
printf(“There is no I-8088W at slot %d\n”,slotIndex);
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 24
3.1.2. i8088W_GetFirmwareVersion
The function is used to get the firmware version of I-8088W.
Syntax
short i8088W_GetFirmwareVersion(int slot);
Parameters
slot: 1 ~ 8
Return Value
The firmware version of I-8088W hardware.
Example
[C]
short firmware_version;
Open_Slot(slot);
firmware_version = i8088W_GetFirmwareVersion(int slot);
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 25
3.1.3. i8088W_GetLibVersion
The function is used to get the version of library file.
Syntax
short i8088W_GetLibVersion(void);
Parameters
None
Return Value
The versions of library file.
Example
[C]
short version;
Open_Slot(slot);
version = i8088W_GetLibVersion();
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 26
3.1.4. i8088W_SetPWMDuty
The function is used to set the related PWM parameters.
Syntax
short i8088W_SetPWMDuty(int slot,int ch,unsigned long hz,unsigned int duty);
Parameters
slot: 1 ~ 8
ch: 0 ~ 7
hz: 0 ~ 450K
duty High part: 0 ~ 99
Low part: 100 - High part
Return Value
Please refer to Error Code Table.
Example
[C]
int ch, slot = 1;
Open_Slot(slot);
for(ch=0;ch<8;ch++)
{
i8088W_ SetPWMDuty (slot, ch, 50);
}
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 27
3.1.5. i8088W_SetPWMDuty_Deci
The function is used to set the PWM parameters precisely.
Syntax
short i8088W_SetPWMDuty_Deci (int slot,int ch,unsigned long deci_Hz,unsigned
int deci_duty);
Note
i8088W_SetPWMDuty_Deci is the same as i8088W_SetPWMDuty_float in usage,
but the i8088W_SetPWMDuty_Deci will run faster than i8088W_SetPWMDuty_floa
for the floating calculation reason
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 28
Example
[C]
int slot,ch;
slot = 1;
Open_Slot(slot);
for(ch=0;ch<8;ch++)
{
i8088W_ SetPWMDuty_Deci(slot,ch,50.3);
}
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 29
3.1.6. i8088W_SetPWMDuty_float
The function is used to set the PWM parameters precisely
Syntax
short i8088W_SetPWMDuty_Float(int slot,int ch,float f_Hz,float f_Duty);
Note
i8088W_SetPWMDuty_Deci is the same as i8088W_SetPWMDuty_float in usage,
but the i8088W_SetPWMDuty_Deci will run faster than i8088W_SetPWMDuty_floa
for the floating calculation reason
Parameters
slot: 1 ~ 8
ch: 0 ~ 7
f_Hz 100 means f_Hz = 10 Hz
f_Duty 0.0~99.9, for example: 50.3 means 50.3% High Part
Low Part =100.0- f_Duty = 49.7 means = 49.7%
Return Value
Please refer to Error Code Table.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 30
Example
[C]
int slot,ch;
slot = 1;
Open_Slot(slot);
for(ch=0;ch<8;ch++)
{
i8088W_ SetPWMDuty_Float (slot,ch,50.3);
}
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 31
3.1.7. i8088W_GetRealPWMDuty_Deci
The function will get real frequency and duty that can be produced by 8088W.
Syntax
short i8088W_GetRealPWMDuty_Deci (int slot,int ch,unsigned long*
deci_hz,unsigned int* deci_duty);
Note
The duty and frequency of 8088W PWM is discrete not continuous,when we use
i8088W_SetPWMDuty to configure the duty and frequency, we have to use this function
to check the real duty and frequency which can be produced by 8088W normally, at low
frequency 10K, the configued frequency will be closer to real frequcncy can be
generated.
Parameters
slot: 1 ~ 8
ch: 0 ~ 7
deci_hz: the real frequency produced by 8088W unit (x10Hz)
deci_duty: the real duty produced by 8088W (x10 %)
Return Value
Please refer to Error Code Table.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 32
Example
[C]
unsigned long deci_hz;
unsigned int deci_duty
slot = 1;
Open_Slot(slot);
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 47
3.1.18. i8088W_GetPWMActiveState
The function is used to get PWM status.
Syntax
short i8088W_GetPWMActiveState(int slot,unsigned int *State,int ActiveArr[]);
Parameters
slot: 1 ~ 8
*State: the PWM output status of i-8088 value 0~0xff
ActiveArr[]: the *State value will be parse into Bit Array
When PWM generate pulse output, the state will be 1, we can know which PWM
channel is sending PWM output. If we configure PWM as Burst Count mode, the
PWM output will be stop when it sends confgured count of PWM pulse (for example
1000 pulse) by using this function, we can know the actural PWM output state.
Return Value
Please refer to Error Code Table.
I-8088W API Reference Manual, Version 1.0.2, Oct. 2020 -- 48
Example
[C]
int slot=1,ch,activatedBit[8];
unsigned int activatedState=0;
Open_Slot(slot);