ICP DAS USA PIO-DA4 User Manual
Hide thumbs Also See for PIO-DA4:

Advertisement

Quick Links

Warranty
All products manufactured by ICP DAS are warranted against defective
materials for a period of one year from the date of delivery to the original
purchaser.
Warning
ICP DAS assumes no liability for damages consequent to 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, nor for any
infringements of patents or other rights of third parties resulting from its use.
Copyright
Copyright © 2010 by ICP DAS. All rights are reserved.
Trademark
Names are used for identification only and may be registered trademarks of their
respective companies.
PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb. 2011, PMH-009-29 )
PIO-DA4/DA8/DA16
PIO-DA4U/DA8U/DA16U
PISO-DA4U/DA8U/DA16U
User Manual
Version 2.9
Feb. 2011
1

Advertisement

Table of Contents
loading

Summary of Contents for ICP DAS USA PIO-DA4

  • Page 1 PIO-DA4/DA8/DA16 PIO-DA4U/DA8U/DA16U PISO-DA4U/DA8U/DA16U User Manual Version 2.9 Feb. 2011 Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser. Warning ICP DAS assumes no liability for damages consequent to the use of this product.
  • Page 2: Table Of Contents

    Tables of Contents INTRODUCTION ..........................3 ...........................4 EATURES ..........................5 PECIFICATIONS .........................6 RDER NFORMATION ........................6 RODUCT HECKLIST HARDWARE CONFIGURATION ....................7 ..........................7 OARD AYOUT ......................9 OUNTER RCHITECTURE ......................10 NTERRUPT PERATION D/I/O B ......................17 LOCK IAGRAM D/A A .........................20 RCHITECTURE D/A C ....................21 ONVERSION PERATIONS ........................31 SSIGNMENTS...
  • Page 3: Introduction

    Introduction The PISO-DA4U/DA8U/DA16U and PIO-DA4U/DA8U/DA16U analog output boards support the universal PCI interface (3.3 V/5 V PCI). These cards are equipped with 4/8/16 14-bit analog output channels. Each of the D/A channels features a double-buffered latch. The PISO-DAxU and the PIO-DAxU series cards (universal PCI versions) are fully compatible with the PIO-DAx cards (PCI versions) and users can directly replace the PIO-DAx with either the PISO-DAxU or the PIO-DAxU without any need for software/driver modification.
  • Page 4: Features

    1.1 Features Supports the +5 V PCI bus for PIO-DA series supports the +5 V and +3.3 V PCI bus for PIO-DAxU/PISO-DAxU series Digital input port can be set to either pull-high or pull-low for PIO-DAxU/ PISO-DAxU series Card ID function for PIO-DAxU/PISO-DAxU series Built-in DC/Dc converter with 3000 V isolation for PISO-DAxU series 2500 V...
  • Page 5: Specifications

    1.2 Specifications Model Name PISO-DA4U/DA8U/DA16U PIO-DA4U/DA8U/DA16U Analog Output Isolation Voltage 2500 V (Bus Type) Channels 4/8/16 independent 4/8/16 independent Resolution 14-bit Accuracy 0.01% of FSR ± 2 LSB @ 25 °C, ± 10 V Voltage: +/- 10 V Output Range Current: 0 ~ 20 mA Output Driving +/- 5 mA...
  • Page 6: Order Information

    1.3 Order Information PIO-DA4: PCI bus 4-channel D/A board PIO-DA8: PCI bus 8-channel D/A board PIO-DA16: PCI bus 16-channel D/A board PIO-DA4U: Universal PCI, 4-channel D/A board PIO-DA8U: Universal PCI, 8-channel D/A board PIO-DA16U: Universal PCI, 16-channel D/A board PISO-DA4U: Universal PCI, 4-channel isolated D/A board...
  • Page 7: Hardware Configuration

    Hardware configuration 2.1 Board Layout PIO-DA4/DA8/DA16 Board Layout PIO-DA16 PIO-DA8 CON3 PIO-DA4 CON2 CON1 PCI BUS CON1: 16-channel D/O CON2: 16-channel D/I CON3: 4/8/16-channel D/A converter voltage/current output PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb. 2011, PMH-009-29 )
  • Page 8 PIO-DA4U/DA8U/DA16U and PISO-DA4U/DA8U/DA16U Board Layout CON1: 16-channel D/O CON2: 16-channel D/I CON3: 4/8/16 channel D/A converter voltage/current output SW1: Card ID PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb. 2011, PMH-009-29 )
  • Page 9: Counter Architecture

    2.2 Counter Architecture There is a single 8254(Timer/Counter) chip on the PIO-DA/PISO-DA series board and provides two interrupt sources. The first is a 16-bit timer output (INT0) and the other one is a 32-bit timer output (INT1). The block diagram is shown below: 8254 Timer/Counter CLK0...
  • Page 10: Interrupt Operation

    2.3 Interrupt Operation There are two interrupt sources included in the PIO-DA/PISO-DA series. These two signals are named as INT0 and INT1, and their signal sources are as follows: INT0: 8254 counter0 output (Refer to Sec. 2.2) INT1: 8254 counter2 output (Refer to Sec. 2.2) If only one interrupt signal source is used, the interrupt service routine doesn’t have to identify the interrupt source.
  • Page 11 Level-Trigger and Active_Low. If INT\ generates a low_pulse, the PIO- DA4/8/16 will interrupt the PC once each time. If INT\ is fixed at low_level, the PIO-DA4/8/16 will interrupt the PC continuously. So for the signal pulse_type for INT_CHAN_0/1 must be controlled and must be fixed at a low_level state normally and a high_pulse generated to interrupt the PC.
  • Page 12 INV0/1 = 0 → INT_CHAN_0/1 = inverted state for INT0/1 INV0/1 = 1 → INT_CHAN_0/1 = non-inverted state for INT0/1 As noted above, if INT\ is fixed at a low level state, the PIO-DA4/8/16 will interrupt the PC continuously, so the interrupt service routine should use...
  • Page 13 2.3.3 Initial_high, active_low Interrupt source If INT0 (8254 counter0 output) is an initial_high, active_low signal (depending on 8254 counter mode), the interrupt service routine should use INV0 to invert/non- invert INT0 to generate a high_pulse in the following manner: (Refer to DEMO3.C) Initial settings: now_int_state=1;...
  • Page 14 2.3.4 Initial_low, active_high Interrupt source If INT0 (8254 counter0 output) is an initial_low, active_high signal (depending on the 8254 counter mode), the interrupt service routine should use INV0 to invert/non-invert INT0 to generate a high_pulse in the following manner: (Refer to DEMO4.C) Initial setting: now_int_state=0;...
  • Page 15 2.3.5 Multiple Interrupt Sources Assume: INT0 is initial Low and active High, INT1 is initial High and active Low as below: INT0 INT1 INT0 and INT1 INT0 and INT1 are active at the return to normal same time at the same time INT1 returns to INT1 is active normal...
  • Page 16 /* -------------------------------------------------------------- */ /* Note : 1.The hold_time of INT_CHAN_0 & INT_CHAN_1 must long enoug. 2.The ISR must read the interrupt status again to identify the active interrupt source. 3.The INT_CHAN_0 & INT_CHAN_1 can be active at the same */ time.
  • Page 17: D/I/O Block Diagram

    2.4 D/I/O Block Diagram The PISO-DA/PIO-DA series provides 16 digital input channels and 16 digital output channels, and all signal levels are TTL compatible. The connection diagram and block diagram are as follows: CON2 D/I port 16 bits 16 bits CON1 D/O port 16 bits...
  • Page 18 2.4.1 DI Port Architecture (CON2) When the PC is powered up, all DI port (CON2) operation are disabled. The enabled/disabled status of a DI port is controlled by the RESET\ signal. Refer to Sec. 3.3.1 for more information about the RESET\ signal. The RESET\ signal is in the Low-state all DI operations are disabled The RESET\ signal is in the High-state...
  • Page 19 2.4.2 DO Port Architecture (CON1) When the PC is powered up, the states of all DO channels are cleared low. The RESET\ signal is used to clear the DO states. Refer to Sec. 3.3.1 for more information about the RESET\ signal. The RESET\ signal is in the Low-state all DO channels are cleared to the low state...
  • Page 20: D/A Architecture

    Current Output 14 DA12 Current Output 15 d0~d13 DA13 DA14 d14~d15 DA15 The PIO-DA4/8/16 provides 4/8/16 channels of double-buffered digital to analog output and provides voltage output and current output simultaneously. PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb. 2011, PMH-009-29 )
  • Page 21: D/A Conversion Operations

    2.6 D/A Conversion Operations The D/A converters on PISO-DA/PIO-DA series cards use 14-bit resolution, so the digital data values range from 0x0000 to 0x3fff. The hardware is designed to output voltage in a range from -10.1 ~ +10.1 volts, as follows: 0x0000 →...
  • Page 22 Consequently, the software can be used to calibrate the analog output without the need for any hardware Trim-pot adjustment. For example, Channel n MinV[n] MaxV[n] MinI[n] MaxI[n] 16297 8180 15943 16293 8172 15976 16296 8199 15949 16391 8177 15963 16298 8165 15955 16292...
  • Page 23 2.6.1 Output Range and Resolution The voltage output range for PISO-DA/PIO-DA series cards is always ±10.1 V, and the current output range is always 0~22 mA, as illustrated below: Voltage Current Hex Value Channel Output Channel Output +10.1V +10.1V 22mA 22mA 0X3FFF +5.05V...
  • Page 24 2.6.2 ±10 V Voltage Output The voltage output for PISO-DA/PIO-DA series cards is always in the range of ±10.1 V. If the user needs to output a voltage in the range of ±10 V, the software calibration is the same as that described in Sec. 2.6. Consequently, Vout will be in the range of ±10 V, so the DaValue will approximately be from 0x0000 to 0x3fff, which means that the resolution is about 14 bits.
  • Page 25 2.6.6 0~20 mA Current Output The current output for PISO-DA/PIO-DA series cards is always in the range of 0~22 mA. If the user needs to output a current in the range of 0~20 mA, the software calibration is the same as that described in Sec. 2.6. Iout will be in the range of 0~20 mA, so the DaValue will approximately be from 0x1fff to 0x3fff, which means that the resolution is about 13 bits.
  • Page 26 There are so many VRs and jumpers that if makes QC and re-calibration very difficult. Every step must be handled manually, meaning that calibrating these D/A boards is not an enjoyable task. When we designed the PISO-DA/PIO-DA series, we tried to remove many/the these majorities of VRs and jumpers, but still retain the same precision and performance.
  • Page 27 2.6.9 Factory Software Calibration It is recommended that a 16-bit A/D card is used to calibrate the PISO-DA/PIO- DA series cards. The I-7000 series is a set of precise remote control modules and the I-7017 is an 8-channel 16-bit precision A/D module (24-bit sigma-delta A/D converter).
  • Page 28 The steps required to calibrate the current for channel_n are as follows: Step 1: DaValue=0x1fff Step 2: Send the DaValue to hannel_n on the PIO/PISO card Step 3: Measure the current of channel_n on the I-7017 If this value is >= 0 mA, then go to Step 5 Step 4: Increase the DaValue, the return to Step 2 Step 5: MinI[n]=DaValue-1 Step 6: DaValue=0x3fff...
  • Page 29 2.6.10 User Software Calibration The users can perform calibration themselves using a voltage meter and a current meter. Step 1: Run DEMO12.EXE Step 2: Select the card number for the PIO/PISO card that you want to calibrate Step 3: Select the item (MinV[n]/MaxV[n]/MinI[n]/MaxI[n]) that you want to calibrate Step 4: Measure the analog output using the voltage meter or the current meter and decide whether to increase or decrease the DaValue.
  • Page 30 2.6.11 Voltage Output Connection External Internal Output Current D/A Converter Max (+/- 5mA) V out 14-bits Data Load AGND 2.6.12 Current Output Connection External Internal Current Loop 0~20mA Load D/A Converter V out 14-bits Data External Power Supply 9~36V AGND PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb.
  • Page 31: Pin Assignments

    2.7 Pin Assignments CON1: Digital Output Connector Name Name Digital Output 0 Digital Output 1 Digital Output 2 Digital Output 3 Digital Output 4 Digital Output 5 Digital Output 6 Digital Output 7 Digital Output 8 Digital Output 9 Digital Output 10 Digital Output 11 Digital Output 12 Digital Output 13...
  • Page 32 CON3: Analog Output Connector for the PIO-DA4/DA8/DA16 and PISO-DA4U/DA8U/DA16U. Name Name Voltage Output Current Output Voltage Output Current Output Voltage Output Current Output Voltage Output Current Output Analog ground Analog ground Voltage Output Current Output Voltage Output Current Output Voltage Output...
  • Page 33 CON3: Analog Output Connector for the PIO-DA4U/DA8U/DA16U Name Name Voltage Output Current Output Voltage Output Current Output Voltage Output Current Output Voltage Output Current Output Analog ground Voltage Output Current Output Voltage Output Current Output Voltage Output Current Output Voltage Output Current Output Analog ground Voltage Output...
  • Page 34: Daughter Boards

    2.8 Daughter Boards 2.8.1 DB-37 The DB-37 is a general-purpose daughter board for D-sub 37-pin devices, and is designed for easy wiring. 2.8.2 DN-37 The DN-37 is a general-purpose daughter board for the DB-37 using DIN-Rail Mounting, and is designed for easy wiring. 2.8.3 DB-8125 The DB-8125 is a general-purpose screw terminal board, and is designed for easy...
  • Page 35 24 V or to sense a wide range of AC signals. This board can also be used to isolate the host computer from large common-mode voltages, ground loops and transient voltage spikes that often occur in industrial environments. PIO-DA4/8/16 Opto-Isolated PIO-DA4/8/16...
  • Page 36 Form C Relay Normally Open Normally Close 20-Pin cable DB-16R PIO-DA4/8/16 Note: Channels: 16 Form C Relay Relays: Switching up to 0.5 A at 110 V or 1 A at 24 V PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb. 2011, PMH-009-29 )
  • Page 37 50-Pin connector (OPTO-22 compatible), for DIO-24, DIO-48, DIO- 144, PIO-D144, PIO-D96, PIO-D56, PIO-D48, PIO-D24 20-Pin connector for 16 channel digital output, A-82X, A-62X, DIO- 64, ISO-DA16/DA8, PIO-D56, PIO-DA4/8/16 Channel: 16 Form A Relay , 8 Form C Relay Relay: Switching up to 5 A at 110 V /5 A at 30 V PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb.
  • Page 38 DB-24PD DB-16P8R DB-24R DB-24RD DB-24C DB-24PR Db-24PRD DB-24POR DB-24SSR Note: There is no 50-pin flat-cable header on the PIO-DA4/8/16. The PIO- DA4/8/16 has one DB-37 connector and two 20-pin flat-cable headers. PIO-DA/PISO-DA Series User Manual (Ver.2.9, Feb. 2011, PMH-009-29 )
  • Page 39: I/O Control Register

    3.1 How to Find the I/O Address The Plug & Play BIOS will assign an appropriate I/O address for each PIO/PISO series card during the power-on stage. The fixed IDs for the PIO/PISO series cards are shown in the tables below: PIO-DA4 PIO-DA4 PIO-DA4U PISO-DA4U...
  • Page 40 All functions are defined in the PIO.H include file. Refer to Chapter 4 for more information. The relevant driver information is as follows: 1. Allocated resource information: • wBase: The BASE address mapping in this PC • wIrq: The allocated IRQ channel number of this board in this PC 2.
  • Page 41 PIO/PISO series cards installed in this system and save the relevant resource information in the library. Sample program 1: Detect all PIO-DA4/8/16 series cards installed in this PC /* Step 1: Detect all PIO-DA16/8/4 series cards installed in this PC */ wSubVendor=0x80;...
  • Page 42 Sample program 2: Detect all PIO/PISO cards installed in this PC. (Refer to Sec. 4.1 for more information) /* Step 1: Detect all PIO/PISO series cards installed in this PC */ wRetVal=PIO_DriverInit(&wBoards,0xff,0xff,0xff); /* Detect all PIO_PISO series cards */ printf("\nThere are %d PIO_PISO Cards in this PC",wBoards); if (wBoards==0 ) exit(0);...
  • Page 43 /*For PIO_DA4/8/16 series cards */ wRetVal=PIO_DriverInit(&wBoards, wSubVendor,wSubDevice,wSubAux); printf("There are %d PIO-DA16/8/4 Cards in this PC\n",wBoards); /* Step 2: Save the resource information for all PIO-DA4/8/16 series cards installed in this PC */ for (i=0; i<wBoards; i++) PIO_GetConfigAddressSpace(i,&wBase,&wIrq,&t1,&t2,&t3,&t4,&t5); printf("\nCard_%d: wBase=%x, wIrq=%x", i,wBase,wIrq);...
  • Page 44 /* Step 3: Control the PIO-DA4/8/16 cards directly */ wBase=wConfigSpace[0][0] /* get the base address for card_0 */ outport(wBase,1); /* enable all D/I/O operations of card_0 */ wBase=wConfigSpace[1][0]; /* get the base address for card_1 */ outport(wBase,1); /* enable all D/I/O operations of card_1 */ 3.1.3...
  • Page 45: The Assignment Of The I/O Addresses

    Step 1: Remove all PIO-DA4/8/16 series cards from the PC. Step 2: Install a PIO-DA4/8/16 series card into PCI_slot1 on the PC and then PIO_PISO.EXE. Record the results shown for wSlotBus1 and wSlotDevice1.
  • Page 46 A possible sample record: PC’s PCI slot wSlotBus wSlotDevice Slot_1 0x07 Slot_2 0x08 Slot_3 0x09 Slot_4 0x0A PCI-BRIDGE Slot_5 0x0A Slot_6 0x08 Slot_7 0x09 Slot_8 0x07 The procedure outlined above can be used to record all wSlotBus and wSlotDevice information for all slots in the PC. This mapping is fixed for each PC, and can then be used to identify a specific PIO-PISO card in the following manner: Step 1: Record all wSlotBus and wSlotDevice information.
  • Page 47: The I/O Address Map

    3.3 The I/O Address Map The I/O address for PIO-DA/PISO-DA series cards is automatically assigned by the ROM BIOS of the PC and provides Plug & Play capabilities for PIO/PISO series cards. The PIO-DA/PISO-DA series I/O addresses are mapped as follows: Address Read Write...
  • Page 48 3.3.1 RESET\ Control Register (Write): wBase+0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Reserved Reserved Reserved Reserved Reserved Reserved Reserved RESET\ Note: Refer to Sec. 3.1 for more information regarding wBase. When the PC is first powered on, the RESET\ signal is in the Low-state.
  • Page 49 3.3.4 INT Mask Control Register (Write): wBase+5 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Note. Refer to Sec. 3.1 for more information regarding wBase. EN0 = 0 Disable INT0 as an interrupt signal (default) EN0 = 1 Enable INT0 as an interrupt signal EN1 = 0...
  • Page 50 3.3.6 Aux Status Register (Read): wBase+7 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Aux7 Aux6 Aux5 Aux4 Aux3 Aux2 Aux1 Aux0 Note: Refer to Sec. 3.1 for more information regarding wBase. Aux0=INT0, Aux1=INT1, Aux2~3= EEPROM control, Aux4~7=Aux-ID.
  • Page 51 3.3.8 Digital Input (Read): wBase+0xe0 Low byte of the D/I port Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 (Read): wBase+0xe4 High byte of the D/I port Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 DI15 DI14 DI13 DI12 DI11 DI10 Note: Refer to Sec.
  • Page 52 3.3.10 Read/Write 8254 (Read/Write): wBase+0xc0=8254-counter-0 (Read/Write): wBase+0xc4=8254-counter-1 (Read/Write): wBase+0xc8=8254-counter-2 (Read/Write): wBase+0xcc=8254 control word 8254 Control Word [BCD]: 0: binary count 1: BCD count [M2, M1, M0]: 000: mode0 interrupt on terminal count 001: mode1 programmable one-shot 010: mode2 rate generator 011: mode3 square-wave generator 100: mode4 software-triggered pulse 101: mode5 hardware-triggered pulse...
  • Page 53 3.3.11 D/A Select There are 1/2/4 D/A converters in PIO-DA4/8/16 cards. It is necessary to select which D/A converter is desired after the D/A data has be sent. D/A channels are allocated as follows: Write Description D/A output channel 0...
  • Page 54 3.3.12 D/A Data Output (write):wBase+0xf0 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 (write):wBase+0xf4 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 Note: Refer to Sec.3.3.10 For more information regarding A1 and A2 Each D/A converter have four analog output channels. When writing data to the D/A converter, the relevant channel to be used is indicated by A1 and A0.
  • Page 55: Sotfware Installation

    Sotfware Installation The PIO-DA and PISO-DA series cards can be used in DOS and Windows 98/ME/NT/2K and 32-bit/64-bit Windows XP/2003/Vista/7. The recommended installation procedure for windows is given in Sec. 4.1 ~ 4.2. Or refer to Quick Start Guide (CD:\NAPDOS\PCI\PIO-DA\Manual\QuickStart\). http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/pio-da/manual/quickstart/ Software Installing Procedure UniDAQ SDK driver (32-bit/64-bit Windows XP/2003/Vista/7):...
  • Page 56: Pnp Driver Installation

    The setup program will then start the driver installation and copy the relevant files to the specified directory and register the driver on your computer. The directory where the drive is stoned is different for different windows versions, as shown below. Windows 64-bit Windows XP/2003/Vista/7: The UniDAQ.DLL file will be copied into the C:\WINNT\SYSTEM32 folder The NAPWNT.SYS and UniDAQ.SYS files will be copied into the...
  • Page 57: Confirm The Successful Installation

    4.3 Confirm the Successful Installation Make sure the PIO-DA and PISO-DA series card installed are correct on the computer as follows: Step 1: Select “Start” “Control Panel” and then double click the “System” icon on Windows. Step 2: Click the “Hardware” tab and then click the “Device Manager” button. Step 3: Check the PIO-DA or PISO-DA series card which listed correctly or not, as illustrated below.
  • Page 58: Demo Programs

    Demo Programs Demo Programs 5.1 Demo Programs for Windows 5.1 Demo Programs for Windows Please note that none of the demo programs will work normally if the DLL driver has not been installed correctly. During the DLL driver installation process, the install shield will register the correct kernel driver to the operating system and copy the DLL driver and demo programs to the correct location depending on the driver software package you have selected (Win98/Me/NT/2K and 32-bit Win...
  • Page 59: Demo Programs For Dos

    5.2 Demo Programs for DOS The related DOS software and demos are located on the CD as below: CD:\NAPDOS\PCI\PIO-DA\dos\ http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/pio-da/dos/ After installing the software, the following drivers will be installed onto your hard disk: \TC\*.* for Turbo C 2.xx or above \TC\LIB\*.* for TC library \TC\DEMO\*.*...
  • Page 60 A list of available demo programs is as follows: DEMO1.EXE: D/O demo program DEMO2.EXE: D/I/O demo program DEMO3.EXE: Single interrupt source (initial high) DEMO4.EXE: Single interrupt source (initial low) DEMO5.EXE: Two interrupt source DEMO6.EXE: Waveform generator without calibration DEMO7.EXE: Waveform generator with calibration DEMO8.EXE: D/A hex value output without calibration DEMO9.EXE: D/A hex value output with calibration DEMO10.EXE: Save EEPROM data to file...
  • Page 61: Pio_Piso.exe For Windows

    for Windows 5.3 PIO_PISO.EXE The PIO_PISO.exe utility is located on the CD as below and is useful for all PIO/PISO series cards. CD:\NAPDOS\PCI\Utility\Win32\PIO_PISO\ http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/utility/win32/pio_piso/ After executing the utility, detailed information for all PIO/PISO cards that are installed in the PC will be shown, as illustrated below: Note: The PIO_PISO.EXE application is valid for all PIO/PISO cards.
  • Page 62: Demo1

    5.4 DEMO1 /* -------------------------------------------------------------------------- */ /* DEMO1: D/O demo for PIO-DA16/8/4 /* Step 1: Run DEMO1.EXE under DOS /* Step 2: Check the LEDs of DB-24C will turn on sequentially /* ------------------------------------------------------------------------- */ #include "PIO.H" void pio_da16_do(WORD wDo); WORD wBase,wIrq; int main() int i,j;...
  • Page 63: Demo2

    5.5 DEMO2 /* ---------------------------------------------------------------------------------- */ /* DEMO2: D/I/O demo for PIO-DA16/8/4 /* Step 1: Connect CON1 & CON2 with a 20-pin 1 to 1 flot cable /* Step 2: Run DEMO2.EXE under DOS /* --------------------------------------------------------------------------------- */ #include "PIO.H" void pio_da16_di(WORD *wDi); void pio_da16_do(WORD wDo);...
  • Page 64: Demo3

    5.6 DEMO3 /* --------------------------------------------------------------------------------------- */ /* DEMO3: INT_CHAN_1, timer interrupt demo (initial high) (It is designed to be a machine independent timer) /* Step1: Run DEMO3.EXE under DOS /* -------------------------------------------------------------------------------------- */ #include "PIO.H" #define A1_8259 0x20 #define A2_8259 0xA0 static void interrupt irq_service(); void pio_da16_c0(char cConfig, char cLow, char cHigh);...
  • Page 65 /* CLK source = 4 MHz */ pio_da16_c1(0x76,0x90,0x01); /* COUNTER1, mode3, div pio_da16_c2(0xb6,0x10,0x27); /* COUNTER2, mode3, div 10000 */ /* program Cout2 1Hz /* note : the 8254 need extra 2-clock for initialization for (;;) if ((inportb(wBase+7)&2)==2) break; /* wait Cout2 = high /* note : Cout2 = high, INV1 must select the inverted Cout2 -->...
  • Page 66: Demo5

    5.7 DEMO5 /* --------------------------------------------------------------------------- */ /* DEMO5 : INT_CHAN_0 & INT_CHAN_1 timer interrupt demo (It is designed to be a machine independent timer) /* Step 1: Run DEMO5.EXE under DOS /* ------------------------------------------------------------------------- */ #include "PIO.H" #define A1_8259 0x20 #define A2_8259 0xA0 static void interrupt irq_service();...
  • Page 67 /* CLK source = 4 MHz */ pio_da16_c0(0x36,0x20,0x4e); /* COUNTER0, mode3, div 20000 */ /* program Cout0 200Hz pio_da16_c1(0x76,0x90,0x01); /* COUNTER1, mode3, div 400 pio_da16_c2(0xb6,0x64,0x00); /* COUNTER2, mode3, div 100 /* program Cout2 100Hz /* note : the 8254 need extra 2-clock for initialization for (;;) if ((inportb(wBase+7)&3)==3) break;...
  • Page 68: Demo8

    5.8 DEMO8 /* -------------------------------------------------------------------- */ /* DEMO8: D/A Output without calibration /* Step1: Run DEMO8.EXE under DOS /* -------------------------------------------------------------------- */ #include "PIO.H" void pio_da16_da(int cChannel_no,int iVal); WORD wBase,wIrq; int main() i,j,k; WORD wBoards,wRetVal,t1,t2,t3,t4,t5,t6; WORD wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice; clrscr(); /* Step 1: find address-mapping of PIO/PISO cards /* Step 2: enable all D/I/O port outportb(wBase,0x11);...
  • Page 69: Demo9

    5.9 DEMO9 /* ----------------------------------------------------------------- */ /* DEMO9 : D/A Output with calibration /* step1 : Run DEMO9.EXE under DOS /* ---------------------------------------------------------------- */ #include "PIO.H" void pio_da16_da(int cChannel_no,int iVal); WORD wBase,wIrq; WORD wN10V[16],wP10V[16],w00mA[16],w20mA[16],EEP; float fDeltaV[16],fDeltaI[16]; int main() i,j,k; WORD wBoards,wRetVal,t1,t2,t3,t4,t5,t6; WORD wSubVendor,wSubDevice,wSubAux,wSlotBus,wSlotDevice; clrscr();...
  • Page 70 printf("\n\n 1.23V Voltage output to each channel"); for (i=0; i<16; i++) j=(1.23+10.0)/fDeltaV[i]+wN10V[i]; pio_da16_da(i,j); getch(); printf("\n\n (b) 1.23mA Current output to each channel"); for (i=0; i<16; i++) j=1.23/fDeltaI[i]+w00mA[i]; pio_da16_da(i,j); getch(); outportb(wBase+5,0); /* disable all interrupt outportb(wBase+3,0); /* all D/O are Low outportb(wBase+2,0);...

Table of Contents