background image

Operation Theorem 

 35 

4.5  Timer/Counter Operation 

The PCI-9112 has an interval timer/counter 8254 on board. It offers 3 
independent 16-bit programmable down counters; counter 1 and counter 
2 are cascaded together for A/D timer pacer trigger of A/D conversion, 
and counter 0 is free for your applications. Figure 3.10 shows the 8254 
timer/counter connection.  
 
 

Counter 0

Counter 1

Counter 2

CLK0
GATE0

OUT0

CLK1
GATE1

CLK2
GATE2

OUT1

OUT2

   2MHz
Oscillator

Vcc

A/D Trigger

CN3 Pin-34

CN3 Pin-37

CN3 Pin-33

CN3 Pin-16

CN3 Pin-35

INT

EXT

8254 Timer/Counter

 

 

Figure 4.5  Block Diagram of 8254 Timer/Counter 

 
 
The clock source of counter 0 can be internal or external, while the gate 
can be controlled externally and the output is send to the connector CN3.   
As to counter 0 and counter 1, the clock source is internally fixed, while 
the gate can be controlled externally and the output is send to the 
connector CN3 too.  All the timer/ counter signals are TTL compatible. 
 
The following s hows how to configure the 8254 timer / counter chip. 
 
The 8254 Timer / Counter Chip 
The Intel (NEC) 8254 contains three independent, programmable, multi-
mode 16 bit counter/timers. The three independent 16 bit counters can be 
clocked at rates from DC to 5  MHz. Each counter can be individually 
programmed with 6 different operating modes by appropriately formatted 
control words. The most commonly uses for the 8254 in microprocessor 
based system are: 
 

Ø 

programmable baud rate generator 

Summary of Contents for NuDAQ 9112 Series

Page 1: ...NuDAQ NuIPC 9112 Series Multi function DAS Cards for PCI 3U CompactPCI User s Manual ...

Page 2: ...sing out of the use or inability to use the product or documentation even if advised of the possibility of such damages This document contains proprietary information protected by copyright All rights are reserved No part of this manual may be reproduced by any mechanical electronic or other means in any form without prior written permission of the manufacturer Trademarks NuDAQ NuIPC are registere...

Page 3: ...RO nupro ADLINK com tw Software sw ADLINK com tw AMB amb ADLINK com tw TEL 886 2 82265877 FAX 886 2 82265717 Address 9F No 166 Jian Yi Road Chungho City Taipei 235 Taiwan R O C Please inform or FAX us of your detailed information for a prompt satisfactory and constant service Detailed Company Information Company Organization Contact Person E mail Address Address Country TEL FAX Web Site Questions ...

Page 4: ......

Page 5: ...Installation for Windows Systems 7 2 4 PCB Layout 8 2 5 Jumper Settings 10 2 6 Analog Input Channel Configuration 10 2 7 Clock Source Setting 11 2 8 D A Reference Voltage Setting 11 2 9 Connectors Pin Assignments 13 2 9 1 Pin Assignments of PCI 9112 13 2 9 2 Pin Assignments of cPCI 9112 15 2 10 Hardware Installation Outline 16 2 11 Device Installation for Windows Systems 16 2 12 Daughter Board Con...

Page 6: ...Digital Input and Output 34 4 5 Timer Counter Operation 35 Chapter 5 C C Library 39 5 1 Libraries Installation 39 5 2 Programming Guide 40 5 2 1 Naming Convention 40 5 2 2 Data Types 40 5 3 _9112_Initial 41 5 4 _9112_DI 42 5 5 _9112_DI _Channel 42 5 6 _9112_DO 43 5 7 _9112_DA 44 5 8 _9112_AD_Set_Channel 45 5 9 _9112_AD_Set_Range 46 5 10 _9112_AD_Set_Mode 47 5 11 _9112_AD_Set_Autoscan 48 5 12 _9112...

Page 7: ...le 65 Chapter 6 Calibration 67 6 1 What do you need 67 6 2 VR Assignment 68 6 3 A D Adjustment 68 6 3 1 Bipolar Calibration 68 6 3 2 Unipolar Calibration 68 6 4 D A Adjustment 69 6 4 1 Reference Voltage Calibration 69 6 4 2 D A Channel Calibration 69 Chapter 7 Software Utilities 70 7 1 Software Utility 70 7 1 1 Running the Utility 71 7 1 2 System Configuration 71 7 1 3 Calibration 71 7 1 4 Functio...

Page 8: ...nectors pin assignment and how to connect the outside signal and devices are also described Ø Chapter 3 Registers Format describes the details of register format and structure of the PCI 9112 this information is very important for the programmers who want to control the hardware by low level programming Ø Chapter 4 Operation Theorem describes how to operate the PCI 9112 The A D D A DIO and timer c...

Page 9: ...d provides the following advanced features Ø 32 bit PCI Bus Ø 12 bit analog input resolution Ø On board A D FIFO memory Ø Auto scanning channel selection Ø Up to 110Khz A D sampling rates Ø 16 single ended or 8 differential analog input channels Ø Bipolar or unipolar input signals Ø Programmable gain of x0 5 x1 x2 x4 x8 Ø On chip sample hold Ø Two 12 bit monolithic multiplying analog output channe...

Page 10: ...nnel 16 single ended or 8 differential Ø Input Range Programmable Ø Bipolar 10V 5V 2 5V 1 25V 0 625V Ø Unipolar 0 10V 0 5V 0 2 5V 0 1 25V Ø Conversion Time 8 µ sec Ø Throughput 110KHz multiplexing maximum Ø Analog Input Over voltage Protection Continuous 35V max Ø Accuracy GAIN 0 5 1 0 01 of FSR 1 LSB GAIN 2 4 0 02 of FSR 1 LSB GAIN 8 0 04 of FSR 1 LSB Ø Input Impedance 10 MΩ Ø Trigger Modes Softw...

Page 11: ... 5V at 8 0mA Sink Ø High Min 2 7V at 0 4mA Source u Programmable Counter Ø Timer Counter Device 8254 Ø A D pacer timer 32 bit timer two 16 bit counter cascaded together with a 2MHz time base Ø Pacer Frequency Range 0 00046 Hz 100K Hz Ø Counter One 16 bit counter with a 2MHz time base u General Specifications Ø Connector 37 pin D type connector Ø Operating Temperature 0 C 60 C Ø Storage Temperature...

Page 12: ...e u Windows 95 DLL For VB VC Delphi BC5 the functions descriptions are included in this user s guide u PCIS DASK Include device drivers and DLL for Windows 98 Windows NT and Windows 2000 DLL is binary compatible across Windows 98 Windows NT and Windows 2000 That means all applications developed with PCIS DASK are compatible across Windows 98 Windows NT and Windows 2000 The developing environment c...

Page 13: ... instrument functions such as FFT analysis Please contact us to get DASYLab PRO which include DASYLab and ADLink hardware drivers 1 4 6 PCIS DDE DDE Server and InTouch TM DDE stands for Dynamic Data Exchange specifications The PCIS DDE includes the PCI cards DDE server The PCIS DDE server is included in the ADLINK CD It needs license The DDE server can be used conjunction with any DDE client under...

Page 14: ... 2 10 u Install the software drivers and run utility to test section 2 11 u Cabling with external devices section 2 9 and 2 12 2 1 What You Have In addition to this User s Guide the package includes the following items Ø PCI 9112 or cPCI 9112 Enhanced Multi function DAS Card Ø ADLINK Software CD Ø Software Installation Guide If any of these items is missing or damaged contact the dealer from whom ...

Page 15: ...static wristband grounded at the same point as the anti static mat Inspect the card for obvious damage Shipping and handling may cause damage to your module Be sure there are no shipping and handing damages on the module before processing Note DO NOT ATTEMPT TO INSTALL A DAMAGED BOARD IN THE COMPUTER You are now ready to install your card 2 3 Device Installation for Windows Systems Once Windows 95...

Page 16: ... Layout CN1 PCI 9112 Multi function DA C JP 5 SING DIFF ADS 774 CN2 CN3 DC DC Converter INTREF EXTREF JP 4 10V 5V JP 3 SING JP 1 ALTERA PCI Bus Controller DIFF EXTCLK INTCLK JP 2 Figure 2 1 PCB Layout of the PCI 9112 VR7 VR6 VR5 VR4 VR3 VR2 ...

Page 17: ...Installation 9 cPCI 9112 Layout Figure 2 2 PCB Layout of the PCI 9112 ...

Page 18: ... These setting are listed as below Configurat ion Attributes Jumpers PCI 9112 Jumpers cPCI 9112 Analog Inputs Single ended or Differential Analog Input JP1 and JP5 JP1 and JP4 Clock Source Internal Clock or External Clock JP2 JP2 D A Reference Voltage 10V or 5V JP3 JP3 D A Reference Source Internal Reference or External Reference JP4 JP5 Table 2 1 Jumpers Listing Table 2 6 Analog Input Channel Con...

Page 19: ...counter 2 The channel 0 is free for user s applications There are two selections for the clock source of channel 0 the internal 2MHz clock or the external clock signal from connector CN3 pin 35 The setting of clock is shown as Figure 2 3 Internal Clock Source 2MHz default setting External Clock Source JP2 JP2 INTCLK EXTCLK INTCLK EXTCLK Figure 2 3 Timer s Clock Source Setting 2 8 D A Reference Vol...

Page 20: ...e 2 4 Analog Output Voltage Setting The internal A D reference voltage can be set to 5V or 10V by JP3 The possible configurations are specified as Figure 2 5 Note that the internal reference voltage is used only when the JP4 is set to internal reference only Reference Voltage is 5V default setting J P 3 10V 5V J P 3 10V 5V Reference Voltage is 10V Figure 2 5 Internal Reference Voltage Setting Note...

Page 21: ...ut Output Counter Timer for single ended connection for differential connection AI2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 30 20 31 32 33 34 35 36 37 AI3 AI10 AI9 AI8 AI1 AI0 AI6 AI7 AI5 AI4 AI13 AI14 AI12 AI11 AO1 A GND AI15 A GND A GND A GND V REF ExtRef2 ExtRef1 AO2 A GND 12V D GND GATE0 GATE COUT1 N C ExtCLK N C 5V ExtTrg COUT0 CN3 Figure 2 9 1 Pin Assignmen...

Page 22: ...I 9 DI 11 DI 13 DI 15 GND 12V 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Figure 2 9 2 Pin Assignment of CN1 CN 2 Digital Signal Output DO 0 15 DO 0 DO 2 DO 4 DO 6 DO 8 DO 10 DO 12 DO 14 GND 5V CN2 DO 1 DO 3 DO 5 DO 7 DO 9 DO 11 DO 13 DO 15 GND 12V 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Figure 2 9 3 Pin Assignment of CN2 Legend DO n Digital output signal channel n DI n Digital i...

Page 23: ... for 8254 Timer 1 2 ExtRef n External Reference Voltage for D A CH n DAn Analog Output Channel n n 1 2 REFout Internal Voltage Reference Output 5Vout Internal 5V Output 12Vout Internal 12V Output A GND Analog Ground GND Ground 1 DOUT_0 26 DIN_9 51 GND 76 GND 2 DOUT_1 27 DIN_10 52 GND 77 GND 3 DOUT_2 28 DIN_11 53 GND 78 GND 4 DOUT_3 29 DIN_12 54 GND 79 GND 5 DOUT_4 30 DIN_13 55 GND 80 GND 6 DOUT_5 ...

Page 24: ...ility to operate this board well Installation Procedures 1 Turn off your computer 2 Turn off all accessories printer modem monitor etc connected to your computer 3 Remove the cover from your computer 4 Setup jumpers on the PCI or CompactPCI card 5 Select a 32 bit PCI slot PCI slot are short than ISA or EISA slots and are usually white or ivory 6 Before handling the PCI cards discharge any static b...

Page 25: ...ompensation circuit on board You can directly connect the thermocouple on the ACL 8125 board The CJC only suitable for High Gain version board 2 12 2 Connect with ACLD 9137 The ACLD 9137 is a direct connector for the card which is equipped with 37 pin D sub connector This board provides a simple way for connection It is very suitable for the simple applications that do not need complex signal cond...

Page 26: ...by using this board you can control outside device through the digital output signals 2 12 5 Connect with ACLD 9138 and ACLD 9188 ACLD 9138 and ACLD 9188 are general purpose terminal boards for all the card which comes equipped with 37 pin D sub connector The ACLD 9138 has a LED indicator to show the power ON OFF of your computer system ACLD 9188 PCI 9112 CN2 CN1 CN3 ...

Page 27: ...d and write will base on 32 bit data There are three types of registers on the PCI 6308 PCI Configuration Registers PCR Local Configuration Registers LCR and 9112 registers The PCR which compliant to the PCI bus specifications is initialized and controlled by the plug play PnP PCI BIOS User s can study the PCI BIOS specification to understand the operation of the PCR Please contact with PCISIG to ...

Page 28: ...rs The PCI 9112 provides 16 single ended or 8 differential A D input channels the digital data will store in the A D data registers The 12 bits A D data is put into 32 bits registers Address BASE 10 Attribute read only Data Format Bit 7 6 5 4 3 2 1 0 BA SE 10 A D 3 A D 2 A D 1 A D 0 C H 3 C H 2 C H 1 C H 0 BA SE 11 A D 1 1 A D 1 0 A D 9 A D 8 A D 7 A D 6 A D 5 A D 4 BA SE 12 BA SE 13 AD11 AD0 Anal...

Page 29: ...used for D A channel 2 Address BASE 10 Attribute write only Data Format for D A Channel 1 Bit 3 2 0 Bas e 10 D A 3 D A 2 D A 0 Bas e 11 D A 1 1 D A 1 0 D A 8 Bas e 12 Bas e 14 Address BASE 14 Attribute write only Data Format for D A Channel 2 Bit 3 2 1 0 Base 14 D A 3 D A 2 D A 1 D A 0 Base 15 D A 1 1 D A 1 0 D A 9 D A 8 Base 16 Base 17 DA0 is the LSB and DA11 is the MSB of the 12 bits data don t ...

Page 30: ...MUX Auto Scan A D Mode Base 19 GAIN M U X Base 1A Base 1B A D Mode Bit 3 Bit 2 Bit 1 Bit 0 EITS TSTS INTX DMA X EITS External Internal Trigger Source 1 External Trigger Source 0 Internal Trigger Source TPST Timer Pacer Software Trigger 1 Timer Pacer Trigger 0 Software Trigger It is only available when the Internal Trigger Source is selected INTX Interrupt Transfer Mode 1 Enable Interrupt Transfer ...

Page 31: ... M1 M0 is converted only 1 The converted channel will be selected by the sequence M3 M2 M1 M0 to 0 for example the MUX register is 0110 and the auto scan bit is enabled then the channel scan sequence is CH6 CH5 CH4 CH3 CH2 CH1 CH0 CH6 CH5 MUX Register Bit8 Bit5 The converted A D channel is controlled by the register MUX the format of MUX is show as table below Bit 8 M 3 Bit 7 M 2 Bit 6 M 1 Bit 5 M...

Page 32: ... its corresponding input range is shown as below Bi t1 2 G 3 Bi t1 1 G 2 Bi t1 0 G 1 Bi t9 G 0 Bipola r or Unipol ar Input Range 1 0 0 0 Bipola r 10V 0 0 0 0 Bipola r 5V 0 0 0 1 Bipola r 2 5V 0 0 1 0 Bipola r 1 25V 0 0 1 1 Bipola r 0 625V 0 1 0 0 Unipol ar 0V 10V 0 1 0 1 Unipol ar 0V 5V 0 1 1 0 Unipol ar 0V 2 5V 0 1 1 1 Unipol ar 0V 1 25V ...

Page 33: ...e 1 A D converted Data is over run 0 A D converted Data is in normal condition DRDY A D Data is Ready 1 A D conversion is completed 0 A D conversion is not completed 3 6 Software Trigger Register If you want to generate a trigger pulse to the PCI 9112 for A D conversion you just write any data to this register and then the A D converter will be triggered Address BASE 20 Attribute write only Data F...

Page 34: ...d control digital outputs Address BASE 1C Attribute read only Data Format Bit 7 6 5 4 3 2 Bas e 1C D I 7 D I 6 D I 5 D I 4 D I 3 D I 2 Bas e 1D D I 1 5 D I 1 4 D I 1 3 D I 1 2 D I 1 1 D I 1 0 Bas e 1E Bas e 1F Address BASE 1C Attribute write only Data Format Bit 7 6 5 4 3 2 Bas e 1C D O 7 D O 6 D O 5 D O 4 D O 3 D O 2 Bas e 1D D O 1 5 D O 1 4 D O 1 3 D O 1 2 D O 1 1 D O 1 0 Bas e 1E Bas e 1F ...

Page 35: ... the detailed register structures and control your PCI 9112 card directly via the high level Application Programming Interface API The software Libraries including DOS Library for Borland C and DLL driver for Windows 95 98 are included in the CD For more detailed information please refer to Chapter 5 C C Software Library 3 10 Low Level Programming To operate the PCI 9112 users do not need to under...

Page 36: ...lowing issues Ø A D front end signal input connection Ø A D conversion procedure Ø A D trigger mode Ø A D data transfer mode Ø Signal Connection 4 2 Analog Input Signal Connection The PCI 9112 provides 16 single ended or 8 differential analog input channels The analog signal can be converted to digital value by the A D converter To avoid ground loops and get more accuracy measurement of A D conver...

Page 37: ...ed Differential input mode The differential input mode provides two inputs that respond to the difference signal between them If the signal source has one side connected to local ground the differential mode can be used for reducing ground loop Figure 3 5 shows the connection of the differential input mode However even if the signal source is local grounded the single ended still can be used when ...

Page 38: ...connected Figure 3 6 shows the connection of differential source AIHn AILn n 0 8 Differential Signal Source To A D Converter VG1 VG2 Vcm VG1 VG2 GND Figure 4 2 3 Differential source and differential input If your signal source is both floating and local ground you should use the differential mode and the floating signal source should be connected as the Figure 3 7 AIHn AILn n 0 8 Floating Signal S...

Page 39: ... is selected there are two internal sources the software trigger and the timer pacer trigger can be used The A D operation mode is controlled by A D mode bits EITS TSTS of A D control register BASE 18 Total three trigger sources are possible in the PCI 9112 The different trigger conditions are specified as follows Software trigger The trigger source is software controllable in this mode That is th...

Page 40: ... triggered by software the software should poll the DRDY bit on the A D Status register until it becomes to high level Whenever the low byte of A D data is read the DRDY bit will be cleared to indicate the data is read out It is possible to read A D converted data without polling The A D conversion time will not excess 8µs on PCI 9112 card Hence after software trigger the software can wait for at ...

Page 41: ...t from the AO1 or AO2 Refer to section 4 3 for information about the D A data registers The mathematical relationship between the Digital number DAn and the output voltage is formulated as following Vout Vref DAn 4096 where the Vref is the reference voltage the Vout is the output voltage and the DAn is the Digital value in D A data registers Before performing the D A conversion users should care a...

Page 42: ...ght forward The digital input operation is just to read data from the corresponding registers and the digital output operation is to write data to the corresponding registers The digital I O registers format are shown in section 4 5 Note that the DIO data channel can only be read or written in form of 16 bits together It is impossible to access individual bit channel Digital Output DO Digital GND ...

Page 43: ...ter 0 can be internal or external while the gate can be controlled externally and the output is send to the connector CN3 As to counter 0 and counter 1 the clock source is internally fixed while the gate can be controlled externally and the output is send to the connector CN3 too All the timer counter signals are TTL compatible The following shows how to configure the 8254 timer counter chip The 8...

Page 44: ...m signal rate is 2MHz 65536 65536 which is a very slow frequency that user may never use it General Purpose Timer Counter The counter 0 is free for users applications The clock source gate control signal and the output signal is send to the connector CN3 The general purpose timer counter can be used as event counter or used for measuring frequency or others functions I O Address The 8254 in the PC...

Page 45: ...C0 Select Counter Bit7 Bit 6 S C 1 S C 0 COUNTER 0 0 Select Counter 0 0 1 Select Counter 1 1 0 Select Counter 2 1 1 ILLEGAL RL1 RL0 Select Read Load operation Bit 5 Bit 4 R L 1 R L 0 OPERATION 0 0 COUNTER LATCH FOR STABLE READ 0 1 READ LOAD LSB ONLY 1 0 READ LOAD MSB ONLY 1 1 READ LOAD LSB FIRST THEN MSB M2 M1 M0 Select Operating Mode Bit 3 Bit 2 Bit 1 M2 M1 M0 MODE 0 0 0 0 0 0 1 1 x 1 0 2 x 1 1 3...

Page 46: ...counter is from 0 up to 9 999 Mode Definitions In 8254 six operating modes can be selected They are Ø Mode 0 Interrupt on Terminal Count Ø Mode 1 Programmable One Shot Ø Mode 2 Rate Generator Ø Mode 3 Square Wave Rate Generator Ø Mode 4 Software Triggered Strobe Ø Mode 5 Hardware Triggered Strobe All detailed description of these six modes are written in Intel Microsystems Components Handbook Volu...

Page 47: ...oping environment can be Visual Basic 4 0 or above Visual C C 4 0 or above Borland C 5 0 or above Borland Delphi 2 x 32 bit or above or any Windows programming language that allows calls to a DLL It provides the C C VB and Delphi include files 5 1 Libraries Installation Please refer to the Software Installation Guide for the detail information about how to install the software libraries for DOS or...

Page 48: ...dows 95 DLL driver e g W_9112_Initial 5 2 2 Data Types We defined some data type in Pci_9112 h DOS and Acl_pci h Windows 95 These data types are used by NuDAQ Cards library We suggest you to use these data types in your application programs The following table shows the data type names and their range Type Name Description Range U8 8 bit ASCII character 0 to 255 I16 16 bit signed integer 32768 to ...

Page 49: ... int base_address int irq_no Visual Basic Windows 95 W_9112_Initial ByVal card_number As Long base_address As Long irq_no As Long As Integer C C DOS int _9112_Initial int card_number int base_address int irq_no u Argument card_number the card number to be initialized only four cards can be initialized the card number must be CARD_1 CARD_2 CARD_3 or CARD_4 base_address the I O port base address of ...

Page 50: ...card_number As Long di_data As Long As Long C C DOS int _9112_DI int card_number unsigned int di_data u Argument card_number the card number of PCI 9112 di_data return all 16 bit value from digital port u Return Code ERR_NoError ERR_BoardNoInit u Example See Appendix A Demo Program DIO_DEMO C 5 5 _9112_DI _Channel u Description This function is used to read data from digital input channels bit The...

Page 51: ...f PCI 9112 di_ch_no the DI channel number the value has to be set from 0 to 15 di_data return value either 0 or 1 u Return Code ERR_NoError ERR_BoardNoInit ERR_InvalidDIChannel u Example include 9112 h main unsigned int data int ch int baseAddr irqNo _9112_Initial CARD_1 baseAddr irqNo Assume NoError when Initialize PCI 9112 for ch 0 ch 16 ch _9112_DI_Channel CARD_1 ch data printf The value of DI ...

Page 52: ...erters There are two Digital to Analog conversion channels on the PCI 9112 The resolution of each channel is 12 bit i e the range is from 0 to 4095 u Syntax Visual C Windows 95 int W_9112_DA int card_number int da_ch_no unsigned int data Visual Basic Windows 95 W_9112_DA ByVal card_number As Long ByVal da_ch_no As Long ByVal da_data As Long As Long C C DOS int _9112_DA int card_number int da_ch_no...

Page 53: ...ster There are 16 single ended or 8 differential analog input channels in PCI 9112 so the channel number should be set between 0 to 15 for signled end analog input mode and 0 to 7 for differnetial analog input mode The initial state is channel 0 which is a default setting by the PCI 9112 hardware configuration u Syntax Visual C Windows 95 int W_9112_ AD_Set_Channel int card_number int ad_ch_no Vis...

Page 54: ...ipolar or Unipolar The initial value of gain is 1 and input type is bipolar which are pre set by the PCI 9112 hardware The relationship between a nalog input voltage range gain and input mode are specified by following tables this table is suitable for PCI 9112 card AD_INPUT GAIN Input type Bipolar or Unipolar Input Range AD_B_5_V 1 Bipolar 5V AD_B_2_5 _V 2 Bipolar 2 5V AD_B_1_2 5_V 4 Bipolar 1 25...

Page 55: ...validRange 5 10 _9112_AD_Set_Mode u Description This function is used to set the A D trigger and data transfer mode by means of writing data to the mode control register The hardware initial state of the PCI 9112 is set as AD_MODE_0 software internal trigger with program polling data For more detailed description of DMA bus mastering mode is specified in section 4 13 A D Mode Description AD_MOD E_...

Page 56: ...2 _9112_AD_Set_Range CARD_1 AD_B_5_V printf The A D analog input range is 5V n _9112_AD_Set_Mode CARD_1 AD_MODE_4 printf Now The Internal Timer Pacer trigger is set n All A D conversion will be trigger by internal timer pacer and the converted data should be transfered in the interrupt service routine ISR 5 11 _9112_AD_Set_Autoscan u Description This function is used to set automatic hardware chan...

Page 57: ...UE or FALSE u Return Code ERR_NoError ERR_BoardNoInit u Example See the demo program AD_DEMO4 C 5 12 _9112_AD_Soft_Trig u Description This function is used to trigger the A D conversion by software When the function is called a trigger pulse will be generated and A D conversion is started and the converted data will be stored in the base address Base 0x10 after the conversion u Syntax Visual C Win...

Page 58: ... 9112 ad_data 12 bit A D converted value the value should be within 0 to 4095 Bit 0 Bit 3 is the converted channel number Bit 4 Bit 15 is the converted A D data u Return Code ERR_NoError ERR_BoardNoInit ERR_AD_AquireTimeOut u Example include 9112 h main int ad_data int errCode Int baseAddr irqNo _9112_Initial CARD_1 baseAddr irqNo Assume NoError when Initialize PCI 9112 Set to software trigger at ...

Page 59: ...rigger DMA transfer it will enable PCI bus master operation This is conceptually similar to DMA Direct Memory Access transfers in a PC but is really PCI bus mastering It does not use an 8237 style DMA controller in the host computer and therefore isn t blocked in 64K max groups PCI 9112 bus mastering works as follows 1 To set up bus mastering first do all normal PCI 9112 initialization necessary t...

Page 60: ...ategy round robin rotated fixed priority custom etc is unique to your host PC and is explicitly not defined by the PCI standard You must determine this priority scheme for your own PC or replace it 5 The interrupt request from the PCI controller can be optionally set up to indicate that this longword count is complete although this can also be determined by polling the PCI controller u Syntax Visu...

Page 61: ...tiguous DMA memory W_9112_Alloc_DMA_Mem will return a memory ID for identify the allocated DMA memory as well as the linear address of the DMA memory for user to access the data The format of the A D data is the same as DOS buffer ad_buffer argument c1 the 16 bit timer frequency divider of timer channel 1 c2 the 16 bit timer frequency divider of timer channel 2 u Return Code ERR_NoError ERR_BoardN...

Page 62: ...this function the internal A D trigger is disable and the A D timer timer 1 and 2 is stopped The function returns the number of the data which has been transferred no matter if the A D DMA data transfer is stopped by this function or by the DMA terminal count ISR u Syntax Visual C Windows 95 int W_9112_AD_DMA_Stop int card_number int count Visual Basic Windows 95 W_9112_AD_DMA_Stop ByVal card_numb...

Page 63: ...d_range int count HANDLE memID int c1 int c2 Visual Basic Windows 95 W_9112_ContDmaStart ByVal card_number As Long ByVal auto_scan As Long ByVal ad_ch_no As Long ByVal ad_range As Long ByVal count As Long ByVal memID As Long ByVal c1 As Long ByVal c2 As Long As Long C C DOS int _9112_ContDmaStart int card_number int auto_scan int ad_ch_no int ad_range int count int db_buffer int c1 int c2 u Argume...

Page 64: ...access the data The format of the A D data is the same as DOS buffer ad_buffer argument c1 the 16 bit timer frequency divider of timer channel 1 c2 the 16 bit timer frequency divider of timer channel 2 u Return Code ERR_NoError ERR_BoardNoInit ERR_InvalidADChannel ERR_AD_InvalidRange ERR_InvalidTimerValue u Example See Demo Program AD_DEMO5 C 5 18 _9112_CheckHalfReady u Description When you use _9...

Page 65: ...Buffer As Long As Long C C DOS int _9112_DblBufferTransfer int card_number unsigned long userBuffer u Argument card_number the card number of PCI 9112 userBuffer user buffer for A D converted data size of user buffer is half of doubleBuf count 2 u Return Code ERR_NoError ERR_BoardNoInit u Example See Demo Program AD_DEMO5 C 5 20 _9112_GetOverrunStatus u Description When you use _9112_ContDmaStart ...

Page 66: ...ERR_NoError ERR_BoardNoInit u Example See Demo Program AD_DEMO5 C 5 21 _9112_ContDmaStop u Description This function is used to stop the continuous DMA data transferring u Syntax Visual C Windows 95 int W_9112_ContDmaStop int card_number Visual Basic Windows 95 W_9112_ContDmaStop ByVal card_number As Long As Long C C DOS int _9112_ContDmaStop int card_number u Argument card_number the card number ...

Page 67: ...Long ByVal ad_range As Long ByVal count As Long ad_buffer As Integer ByVal c1 As Long ByVal c2 As Long As Long C C DOS int _9112_INT_Start int card_number int auto_scan int ad_ch_no int ad_range int count unsigned long ad_buffer int c1 int c2 u Argument card_number the card number of PCI 9112 auto_scan TRUE or FALSE Example1 auto_scan is FALSE ad_ch_no is 3 Using DMA mode to read A D data only cha...

Page 68: ...ecuts in background you can issue the function _9112_AD_INT_Status to check the status of interrupt operation u Syntax Visual C Windows 95 int W_9112_AD_ INT_Status int card_number int status int count Visual Basic Windows 95 W_9112_INT_Status ByVal card_number As Long status As Long count As Long As Long C C DOS int _9112_AD_INT_Status int card_number int status int count u Argument card_number t...

Page 69: ...nt As Long As Long C C DOS int _9112_AD_INT_Stop int card_number int count Argument card_number the card number of PCI 9112 count the number of A D data which has been transferred Return Code ERR_NoError ERR_BoardNoInit Example See Demo Program AD_DEMO2 C AD_DEMO5 C 5 25 _9112_AD_Timer u Description This function is used to setup the Timer 1 and Timer 2 Timer 1 2 are used as frequency divider for ...

Page 70: ...number the card number of PCI 9112 c1 frequency divider of timer 1 c2 frequency divider of timer 2 Note the A D sampling rate is equal to 2MHz c1 c2 when c1 0 or c2 0 the pacer trigger will be stopped u Return Code ERR_NoError ERR_BoardNoInit ERR_InvalidTimerValue u Example main int errCode Int baseAddr irqNo _9112_Initial CARD_1 baseAddr irqNo Assume NoError when Initialize PCI 9112 _9112_AD_Time...

Page 71: ... As Long c0 As Long As Long C C DOS int _9112_TIMER_Start int card_number int timer_mode unsigned int c0 u Argument card_number the card number of PCI 9112 timer_mode the 8253 timer mode the possible values are TIMER_MODE0 TIMER_MODE1 TIMER_MODE2 TIMER_MODE3 TIMER_MODE4 TIMER_MODE5 c0 the counter value of timer u Return Code ERR_NoError ERR_BoardNoInit ERR_InvalidTimerMode ERR_InvalidTimerValue 5 ...

Page 72: ...95 W_9112_TIMER_Stop ByVal card_number As Long counter_value As Long As Long C C DOS int _9112_TIMER_Stop int card_number unsigned int counter_value u Argument card_number the card number of PCI 9112 counter_value the current counter value of the Timer 0 u Return Code ERR_NoError ERR_BoardNoInit 5 29 _9112_Alloc_DMA_Mem u Description Contact Windows 95 system to allocate a block of contiguous memo...

Page 73: ...s 95 environment This function is only available in Windows 95 version u Syntax Visual C Windows 95 int W_9112_Free_DMA_Mem HANDLE memID Visual Basic Windows 95 W_9112_Free_DMA_Mem ByVal memID As Long As Long u Argument memID The memory ID of the system DMA memory to deallocate u Return Code ERR_NoError 5 32 _9112_Get_Sample u Description For the language without pointer support such as Visual Bas...

Page 74: ...rary u Argument linearAddr The linear address of the allocated DMA memory index The index of the sample to retrieve The first sample is with index 0 ai_data Returns the sample retrieved u Return Code ERR_NoError ...

Page 75: ...curacy This chapter will guide you to calibrate your PCI 9112 to an accuracy condition 6 1 What do you need Before calibrating your PCI 9112 card you should prepare some equipment s for the calibration Ø Calibration program Once the program is executed it will guide you to do the calibration This program is included in the delivered package Ø A 5 1 2 digit multimeter 6 1 2 is recommended Ø A volta...

Page 76: ...libration 1 Set the analog input range as 5V i e the gain 1 and input mode Bipolar 2 Short the A D channel 0 pin 1 of CN3 to ground GND and connect the TP1 and TP2 with your DVM Trim the variable resister VR7 to obtain a value as close as possible to 0V 3 Apply a 5V input signal to A D channel 0 and trim the VR2 to obtain reading between 4094 4095 4 Apply a 0V input signal to A D channel 0 and tri...

Page 77: ...tion 1 Connect VDM to CN3 pin 30 AO1 and VDM to A GND 2 Write the Digital value 0x0FFF into registers BASE 10 3 Trim the variable resister VR3 to obtain 5V reading in the DVM D A CH2 calibration 1 Connect VDM to CN3 pin 32 AO2 and VDM to A GND 2 Write the Digital value 0x0FFF into registers Base 14 3 Trim the variable resister VR4 to obtain 5V reading in the DVM A calibration utility is supported ...

Page 78: ...ng menu driven operating mode based on windowing environment so it is very easy to operate and no more learning effort In addition to the Utility and C C DLL Libraries some demonstration programs are also included users can refer them and save a lot of programming time and get some other benefits as well Please refer the Appendix A for details of the demo programs 7 1 Software Utility There are th...

Page 79: ...ardware configuration The top window shows the setting items that you have to set before using the PCI 9112 card The bottom window gives you a layout of PCI 9112 the jumpers and DIP switch are shown on it Whenever you change the attribute of each setting its corresponding jumper will be update immediately You could follow this indication to change the jumper setting on your PCI 9112 board The foll...

Page 80: ... step 7 1 4 Functional Testing This function is used to test multi function of PCI 9112 it includes Digital I O testing D A testing A D testing Timer Testing and DMA testing When you choose the test function from the main menu list a diagram shown below is displayed on the screen the upper window shows the testing items and the bottom window shows the testing results 7 2 PCI SCAN Utility A PCI bus...

Page 81: ...er AD_DEMO4 C A D conversion uses software trigger and program data transfer autoscan enable muli channel AD_DEMO5 C A D conversion uses interrupt and program data transfer autoscan enable muli channel AD_DEMO6 C A D conversion uses DMA data transfer autoscan enable muli channel AD_DEMO5 C Continue A D converted by DMA transfer DA_DEMO C D A conversion DIO_DEMO C Read Write data from digital input...

Page 82: ...12dma exe A D conversion uses DMA data transfer Visual C C program Samples sdk 9112cdma 9112cdma exe A D conversion uses DMA data transfer with double buffering mechanism Visual C C program Samples vb 9112 vb9112 e xe A D conversion uses software trigger and program data transfer D A conversion and digital I O Visual Basic program Samples vb 9112int vb9112i exe A D conversion uses interrupt data t...

Page 83: ...g its specifications or if the serial number has been removed Seller does not assume any liability for consequential damages as a result from our products uses and in any event our liability shall not exceed the original selling price of the equipment The equipment warranty shall constitute the sole and exclusive remedy of any Buyer of Seller equipment and the sole and exclusive liability of the S...

Reviews: