Pc-Dio-96/Pnp User Manual: Digital I/O Board For Isa
Pc-Dio-96/Pnp User Manual: Digital I/O Board For Isa
Pc-Dio-96/Pnp User Manual: Digital I/O Board For Isa
User Manual
Digital I/O Board for ISA
Internet Support
GPIB: gpib.support@natinst.com
DAQ: daq.support@natinst.com
VXI: vxi.support@natinst.com
LabVIEW: lv.support@natinst.com
LabWindows: lw.support@natinst.com
HiQ: hiq.support@natinst.com
VISA: visa.support@natinst.com
Lookout: lookout.support@natinst.com
E-mail: info@natinst.com
FTP Site: ftp.natinst.com
Web Address: http://www.natinst.com
Bulletin Board Support
(512) 418-1111
Telephone Support (U.S.)
Important Information
Warranty
The PC-DIO-96/PnP is warranted against defects in materials and workmanship for a period of one year from the date
of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace
equipment that proves to be defective during the warranty period. This warranty includes parts and labor.
The media on which you receive National Instruments software are warranted not to fail to execute programming
instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced
by receipts or other documentation. National Instruments will, at its option, repair or replace software media that do
not execute programming instructions if National Instruments receives notice of such defects during the warranty
period. National Instruments does not warrant that the operation of the software shall be uninterrupted or error free.
A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the outside
of the package before any equipment will be accepted for warranty work. National Instruments will pay the shipping
costs of returning to the owner parts which are covered by warranty.
National Instruments believes that the information in this manual is accurate. The document has been carefully
reviewed for technical accuracy. In the event that technical or typographical errors exist, National Instruments reserves
the right to make changes to subsequent editions of this document without prior notice to holders of this edition. The
reader should consult National Instruments if errors are suspected. In no event shall National Instruments be liable for
any damages arising out of or related to this document or the information contained in it.
EXCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AND
SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
CUSTOMERS RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL
INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER. NATIONAL INSTRUMENTS
WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR
CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. This limitation of the liability of National
Instruments will apply regardless of the form of action, whether in contract or tort, including negligence. Any action
against National Instruments must be brought within one year after the cause of action accrues. National Instruments
shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided
herein does not cover damages, defects, malfunctions, or service failures caused by owners failure to follow the
National Instruments installation, operation, or maintenance instructions; owners modification of the product;
owners abuse, misuse, or negligent acts; and power failure or surges, fire, flood, accident, actions of third parties, or
other events outside reasonable control.
Copyright
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical,
including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part,
without the prior written consent of National Instruments Corporation.
Trademarks
LabVIEW, NI-DAQ, and SCXI are trademarks of National Instruments Corporation.
Product and company names listed are trademarks or trade names of their respective companies.
Table
of
Contents
Chapter 1
Introduction
About the PC-DIO-96/PnP ........................................................................................... 1-1
What You Need to Get Started ..................................................................................... 1-2
Software Programming Choices ................................................................................... 1-3
LabVIEW and LabWindows/CVI Application Software .............................. 1-3
NI-DAQ Driver Software ............................................................................... 1-3
Register-Level Programming ......................................................................... 1-5
Optional Equipment ...................................................................................................... 1-5
Custom Cabling .............................................................................................. 1-5
Unpacking ..................................................................................................................... 1-7
Chapter 2
Installation and Configuration
Installation .................................................................................................................... 2-1
Hardware Configuration ............................................................................................... 2-3
Plug and Play .................................................................................................. 2-3
Base I/O Address and Interrupt Selection ....................................... 2-3
Non-Plug and Play ......................................................................................... 2-3
Chapter 3
Signal Connections
I/O Connector Pin Description ..................................................................................... 3-1
I/O Connector Signal Connection Descriptions ........................................................... 3-3
Port C Pin Assignments ................................................................................. 3-4
Cable Assembly Connectors ......................................................................................... 3-4
Table of Contents
Chapter 4
Theory of Operation
Data Transceivers ..........................................................................................................4-2
PC I/O Channel Control Circuitry .................................................................................4-2
Plug and Play Circuitry .................................................................................................4-2
Interrupt Control Circuitry ............................................................................................4-2
82C55A Programmable Peripheral Interface ................................................................4-3
82C53 Programmable Interval Timer ...........................................................................4-3
Digital I/O Connector ....................................................................................................4-4
Appendix A
Specifications
Appendix B
OKI 82C55A Data Sheet
Appendix C
OKI 82C53 Data Sheet
Appendix D
Register-Level Programming
Appendix E
Using Your PC-DIO-96 (Non-PnP) Board
Appendix F
Customer Communication
PC-DIO-96/PnP User Manual
vi
Table of Contents
Glossary
Index
Figures
Figure 1-1.
Figure 2-1.
Figure 3-1.
Figure 3-2.
Figure 3-3.
Figure 3-4.
Figure 3-5.
Figure 3-6.
Figure 4-1.
Figure D-1.
Figure D-2.
Figure D-3.
Figure D-4.
Figure D-5.
Figure D-6.
Figure E-1.
Figure E-2.
Figure E-3.
Figure E-4.
vii
Table of Contents
Tables
Table 3-1.
Table 3-2.
Table D-1.
Table D-2.
Table D-3.
Table E-1.
Table E-2.
Table E-3.
viii
About
This
Manual
ix
82C55A
<>
bold
Bold text denotes the names of menus, menu items, or dialog box
buttons or options.
bold italic
italic
monospace
Text in this font denotes text or characters that are to be literally input
from the keyboard, sections of code, programming examples, and
syntax examples. This font is also used for the proper names of disk
drives, paths, directories, programs, subprograms, subroutines, device
names, functions, operations, variables, filenames, and extensions, and
for statements and comments taken from program code.
NI-DAQ
PC-DIO-96/PnP PC-DIO-96/PnP refers to both the Plug and Play and non-Plug and Play
compatible versions of the board.
PC-DIO-96PnP PC-DIO-96PnP refers to the Plug and Play version of the
PC-DIO-96/PnP.
PC-DIO-96
PnP
PnP (Plug and Play) refers to a device that is fully compatible with the
industry standard Plug and Play ISA Specification. All bus-related
configuration is performed through software, freeing the user from
manually configuring jumpers or switches to set the products base
address and interrupt level. Plug and Play systems automatically
arbitrate and assign system resources to a PnP product.
non-PnP
PPI x
SCXI
xi
Getting Started with SCXIIf you are using SCXI, this is the first
manual you should read. It gives an overview of the SCXI system
and contains the most commonly needed information for the
modules, chassis, and software.
Your SCXI hardware user manualsIf you are using SCXI, read
these manuals next for detailed information about signal
connections and module configuration. They also explain in greater
detail how the module works and contain application hints.
SCXI Chassis User ManualIf you are using SCXI, read this
manual for maintenance information on the chassis and installation
instructions.
xii
Related Documentation
If you are a register-level programmer, the following documents
contain information that you may find helpful as you read this manual:
Customer Communication
National Instruments wants to receive your comments on our products
and manuals. We are interested in the applications you develop with our
products, and we want to help if you have problems with them. To make
it easy for you to contact us, this manual contains comment and
configuration forms for you to complete. These forms are in
Appendix F, Customer Communication, at the end of this manual.
xiii
Chapter
Introduction
This chapter describes the PC-DIO-96/PnP; lists what you need to get
started; describes software programming choices, optional equipment,
and custom cables; and explains how to unpack the PC-DIO-96/PnP.
Other computers
1-1
Chapter 1
Introduction
Note:
Panel meters
PC-DIO-96/PnP board
PC-DIO-96/PnP User Manual
One of the following software packages and documentation:
NI-DAQ for PC Compatibles
LabVIEW for Windows
LabWindows/CVI
Your computer
1-2
Chapter 1
Introduction
1-3
Chapter 1
Introduction
Conventional
Programming
Environment
(PC, Macintosh, or
Sun SPARCstation)
LabVIEW
(PC, Macintosh, or
Sun SPARCstation)
LabWindows/CVI
(PC or
Sun SPARCstation)
NI-DAQ
Driver Software
DAQ or
SCXI Hardware
Personal
Computer
or
Workstation
1-4
Chapter 1
Introduction
Register-Level Programming
The final option for programming any National Instruments DAQ
hardware is to write register-level software. Writing register-level
programming software can be very time-consuming and inefficient, and
is not recommended for most users.
Even if you are an experienced register-level programmer, consider
using NI-DAQ, LabVIEW, or LabWindows/CVI to program your
National Instruments DAQ hardware. Using the NI-DAQ, LabVIEW, or
LabWindows/CVI software is easier than, and as flexible as, registerlevel programming, and can save weeks of development time.
Optional Equipment
National Instruments offers a variety of products to use with your
PC-DIO-96/PnP board, including cables, connector blocks, and other
accessories, as follows:
Custom Cabling
National Instruments offers cables and accessories for you to prototype
your application or to use if you frequently change board
interconnections.
You can interface the PC-DIO-96/PnP to a wide range of printers,
plotters, test instruments, I/O racks and modules, screw terminal panels,
and almost any device with a parallel interface. The PC-DIO-96/PnP
digital I/O connector is a standard, 100-pin header connector. Adapters
for this header connector expand the interface to four 50-pin ribbon
cables, each of which has the pinout of a PC-DIO-24. The pin
assignments of the expansion cables are compatible with the standard
National Instruments Corporation
1-5
Chapter 1
Introduction
1-6
Chapter 1
Introduction
Unpacking
Your PC-DIO-96/PnP board is shipped in an antistatic package to
prevent electrostatic damage to the board. Electrostatic discharge can
damage several components on the board. To avoid such damage in
handling the board, take the following precautions:
Remove the board from the package and inspect the board for loose
components or any other sign of damage. Notify National
Instruments if the board appears damaged in any way. Do not
install a damaged board into your computer.
1-7
Chapter
Installation and
Configuration
Installation
Note:
You should install your driver software before installing your hardware.
Refer to your NI-DAQ release notes for software installation instructions.
3
1
Serial Number
W1
F1
2-1
Chapter 2
Note:
The PC-DIO-96PnP uses 100 k resistors for polarity selection at powerup. These signals are pulled up to VCC (+5 VDC, factory default) or pulled
down to GND by selection of jumper W1. The location of W1 is shown in
Figure 2-1. For more information, see the Digital I/O Power-up State
Selection section in Chapter 3, Signal Connections.
You can install the PC-DIO-96PnP in any available expansion slot in
your computer. The following are general installation instructions, but
consult your computer user manual or technical reference manual for
specific instructions and warnings.
1.
2.
3.
4.
Insert the PC-DIO-96PnP board into any 8-bit or 16-bit slot. It may
be a tight fit, but do not force the board into place.
5.
6.
7.
8.
2-2
Chapter 2
Hardware Configuration
Plug and Play
The PC-DIO-96PnP is fully compatible with the industry-standard
Intel/Microsoft Plug and Play Specification. A Plug and Play system
arbitrates and assigns resources through software, freeing you from
manually setting switches and jumpers. These resources include the
board base I/O address and interrupt channels. Each PC-DIO-96PnP is
configured at the factory to request these resources from the Plug and
Play Configuration Manager.
The Configuration Manager receives all of the resource requests at
startup, compares the available resources to those requested, and
assigns the available resources as efficiently as possible to the Plug and
Play boards. Application software can query the Configuration
Manager to determine the resources assigned to each board without
your involvement. The Plug and Play software is installed as a device
driver or as an integral component of the computer BIOS.
2-3
Chapter
Signal Connections
3-1
Chapter 3
Signal Connections
APC7
BPC7
APC6
BPC6
APC5
BPC5
APC4
BPC4
APC3
BPC3
APC2
BPC2
APC1
BPC1
APC0
BPC0
APB7
BPB7
APB6
BPB6
APB5
BPB5
APB4
BPB4
APB3
BPB3
APB2
BPB2
APB1
BPB1
APB0
BPB0
APA7
BPA7
APA6
BPA6
APA5
BPA5
APA4
BPA4
APA3
BPA3
APA2
BPA2
APA1
BPA1
APA0
BPA0
+5 V
GND
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
CPC7
DPC7
CPC6
DPC6
CPC5
DPC5
CPC4
DPC4
CPC3
DPC3
CPC2
DPC2
CPC1
DPC1
CPC0
DPC0
CPB7
DPB7
CPB6
DPB6
CPB5
DPB5
CPB4
DPB4
CPB3
DPB3
CPB2
DPB2
CPB1
DPB1
CPB0
DPB0
CPA7
DPA7
CPA6
DPA6
CPA5
DPA5
CPA4
DPA4
CPA3
DPA3
CPA2
DPA2
CPA1
DPA1
CPA0
DPA0
+5 V
GND
3-2
Chapter 3
Signal Connections
Signal Name
Description
1, 3, 5, 7, 9, 11, 13, 15
APC<7..0>
APB<7..0>
APA<7..0>
BPC<7..0>
BPB<7..0>
BPA<7..0>
CPC<7..0>
CPB<7..0>
CPA<7..0>
DPC<7..0>
DPB<7..0>
DPA<7..0>
+5 V
50, 100
GND
Note:
3-3
Chapter 3
Signal Connections
Programming
Mode
Group A
PC7
PC6
Group B
PC5
PC4
PC3
PC2
PC1
PC0
Mode 0
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
Mode 1 Input
I/O
I/O
IBFA
STBA*
INTRA
STBB*
IBFBB
INTRB
Mode 1 Output
OBFA*
ACKA*
I/O
I/O
INTRA
ACKB*
OBFB*
INTRB
Mode 2
OBFA*
ACKA*
IBFA
STBA*
INTRA
I/O
I/O
I/O
3-4
Chapter 3
APC7
BPC7
APC6
BPC6
APC5
BPC5
APC4
BPC4
APC3
10
BPC3
APC2
11 12
BPC2
APC1
13 14
BPC1
APC0
15 16
BPC0
APB7
17 18
BPB7
APB6
19 20
BPB6
APB5
21 22
BPB5
APB4
23 24
BPB4
APB3
25 26
BPB3
APB2
27 28
BPB2
APB1
29 30
BPB1
APB0
31 32
BPB0
APA7
33 34
BPA7
APA6
35 36
BPA6
APA5
37 38
BPA5
APA4
39 40
BPA4
APA3
41 42
BPA3
APA2
43 44
BPA2
APA1
45 46
BPA1
APA0
47 48
BPA0
+5 V
49 50
GND
Signal Connections
Figure 3-2. Cable Assembly Connector Pin Assignments for Pins 1 through 50
of the PC-DIO-96/PnP I/O Connector
3-5
Chapter 3
Signal Connections
CPC7
DPC7
CPC6
DPC6
CPC5
DPC5
CPC4
DPC4
CPC3
10
DPC3
CPC2
11 12
DPC2
CPC1
13 14
DPC1
CPC0
15 16
DPC0
CPB7
17 18
DPB7
CPB6
19 20
DPB6
CPB5
21 22
DPB5
CPB4
23 24
DPB4
CPB3
25 26
DPB3
CPB2
27 28
DPB2
CPB1
29 30
DPB1
CPB0
31 32
DPB0
CPA7
33 34
DPA7
CPA6
35 36
DPA6
CPA5
37 38
DPA5
CPA4
39 40
DPA4
CPA3
41 42
DPA3
CPA2
43 44
DPA2
CPA1
45 46
DPA1
CPA0
47 48
DPA0
+5 V
49 50
GND
Figure 3-3. Cable Assembly Connector Pin Assignments for Pins 51 through 100
of the PC-DIO-96/PnP I/O Connector
3-6
Chapter 3
Signal Connections
2.2 V min
5.3 V max
-0.3 V min
0.8 V max
-1.0 A min
1.0 A max
3.7 V min
5.0 V max
0.0 V min
0.4 V max
Output current
at VOL = 0.5 V
2.5 mA min
Output current
at VOH = 2.7 V
2.5 mA min
Figure 3-4 depicts signal connections for three typical digital I/O
applications.
3-7
Chapter 3
Signal Connections
+5 V
+5 V
LED
Jumper
Selectable (W1)
100 k
100 k
100 k
100 k
41
PPI A
Port A
APA<3..0>
43
45
47
100 k
100 k
100 k
100 k
67
69
TTL Signal
PPI C
Port B
CPB<7..4>
71
73
+5 V
Switch *
50, 100
GND
I/O Connector
PC-DIO-96/PnP
* Complex switch circuitry is not shown in order to simplify the figure.
In Figure 3-4, PPI A, port A is configured for digital output, and PPI C,
port B is configured for digital input. Digital input applications include
receiving TTL signals and sensing external device states such as the
state of the switch in Figure 3-4. Digital output applications include
sending TTL signals and driving external devices such as the LED
shown in Figure 3-4.
3-8
Chapter 3
Signal Connections
Power Connections
Pins 49 and 99 of the I/O connector are connected to the +5 V supply
from the PC power supply. These pins are referenced to GND and can
be used to power external digital circuitry. This +5 V supply has a 1 A
protection fuse in series. This fuse is self-resetting. Simply remove the
circuit causing the heavy current load and the fuse will reset itself. For
more information on these output pins, see Output Signals in
Appendix A, Specifications.
0.5 A per pin at +5 V 10%
Power rating
3-9
Chapter 3
Signal Connections
PC-DIO-96/PnP +5 V
100 k
82C55
Figure 3-5. DIO Channel Configured for High DIO Power-up State with External Load
Example:
At power up, the board is configured for input and, by default, all DIO
lines are high. To pull one channel low, follow these steps:
1.
Install a load (RL). Remember that the smaller the resistance, the
greater the current consumption and the lower the voltage (V).
2.
; Voltage across RL
I = 46 A + 10 A
Therefore:
RL = 7.1 k
; 0.4 V / 56 A
3-10
Chapter 3
Signal Connections
+5 V
RL
82C55
Figure 3-6. DIO Channel Configured for Low DIO Power-up State with External Load
3-11
Chapter 3
Signal Connections
Example:
At power up, the board is configured for input and jumper W1 is set in
the low DIO power-up state, which means all DIO lines are pulled low.
If you want to pull one channel high, follow these steps:
1.
Install a load (RL). Remember that the smaller the resistance, the
greater the current consumption and the lower the voltage (V).
2.
; voltage across RL
I = 28 A + 10 A
Therefore:
RL = 5.7 k
; 2.2 V / 38 A
Timing Specifications
This section lists the timing specifications for handshaking with the
PC-DIO-96/PnP. The handshaking lines STB* and IBF synchronize
input transfers. The handshaking lines OBF* and ACK* synchronize
output transfers.
The signals in Table 3-2 are used in the timing diagrams later in this
chapter.
3-12
Chapter 3
Table 3-2.
Name
Signal Connections
Type
Description
STB*
Input
IBF
Output
ACK*
Input
OBF*
Output
INTR
Output
RD*
Internal
WR*
Internal
DATA
Bidirectional
3-13
Chapter 3
Signal Connections
T1
T2
T4
STB*
T7
IBF
T6
INTR
RD*
T3
T5
DATA
Name
Description
T1
T2
Minimum
Maximum
100
STB* = 0 to IBF = 1
150
T3
20
T4
STB* = 1 to INTR = 1
150
T5
50
T6
RD* = 0 to INTR = 0
200
T7
RD* = 1 to IBF = 0
150
3-14
Chapter 3
Signal Connections
T3
WR*
T4
OBF*
T1
T6
INTR
T5
ACK*
DATA
T2
Name
Description
Minimum
Maximum
T1
WR* = 0 to INTR = 0
250
T2
WR* = 1 to output
200
T3
WR* = 1 to OBF* = 0
150
T4
ACK* = 0 to OBF* = 1
150
T5
100
T6
ACK* = 1 to INTR = 1
150
3-15
Chapter 3
Signal Connections
T1
WR*
T6
OBF*
INTR
T7
ACK*
T3
STB*
T10
T4
IBF
RD*
T2
T5
T8
T9
DATA
Name
Description
Minimum
Maximum
T1
WR* = 1 to OBF* = 0
150
T2
20
T3
100
T4
STB* = 0 to IBF = 1
150
T5
50
T6
ACK* = 0 to OBF = 1
150
T7
100
T8
ACK* = 0 to output
150
T9
20
250
T10
RD* = 1 to IBF = 0
150
3-16
Chapter
Theory of Operation
PC I/O Channel
Data
Transceivers
82C55A PPI
Port C 8
PC I/O Channel
Control Circuitry
82C55A PPI
Port C 8
82C55A PPI
8
16
Port A 8
Port B 8
PC I/O Interrupt
Address Circuitry
82C55A PPI
Port A 8
Port B 8
Port C 8
Port A 8
Port B 8
Port A 8
Port B 8
Port C 8
INT
Interrupt
Control
Circuitry
82C53 Timer
+5 VDC
1 A Fuse
4-1
Chapter 4
Theory of Operation
Data Transceivers
The data transceivers control the sending and receiving of data to and
from the PC I/O channel.
4-2
Chapter 4
Theory of Operation
The 82C53 device has two of its three counter output signals connected
to the interrupt circuitry. Any of these 10 signals can interrupt the host
computer if the interrupt circuitry is enabled and the corresponding
enable bit is set (see Appendix D, Register-Level Programming, for
more information). Normally, PC3 and/or PC0 of the 82C55A devices
are controlled by the handshaking circuitry; however, either of these
two lines can be configured for input and used as external interrupts. An
interrupt occurs on the low-to-high transition of the signal line. Refer to
Appendix D, Register-Level Programming, Appendix B, OKI 82C55A
Data Sheet, or Appendix C, OKI 82C53 Data Sheet, for more detailed
information.
4-3
Chapter 4
Theory of Operation
4-4
Appendix
Specifications
Digital I/O
Number of channels ...........................96 I/O
Compatibility .....................................TTL
Absolute max voltage rating ..............-0.5 to +5.5 V with respect to
GND
Handshaking ......................................Requires 1 port
Power-on state ...................................Configured as inputs, high
(jumper selectable)
Data transfers.....................................Interrupts, programmed I/O
Digital logic levels .............................
Level
Min
-0.3 V
0.8 V
2.2 V
5.3 V
-1.0 A
1.0 A
0V
0.4 V
3.7 V
5.0 V
-1.0 A
1.0 A
A-1
Max
Appendix A
Specifications
Output signals
Pin 49 (at +5 V) .......................... 0.5 A max
Pin 99 (at +5 V) .......................... 0.5 A max
Note:
The total combined current output from pins 49 and 99 may be limited by
the available current from your computer power supply. To determine the
available current, subtract the maximum power consumption of the board
from the maximum current per slot. The difference, if less than 1 A, is the
maximum combined current available to pins 49 and 99. If the difference
is equal to or greater than 1 A, the maximum current available is restricted
by the limitations of the connector, as shown previously. If your external
circuitry requires 0.5 to 1 A of current, connect pins 49 and 99 in parallel
to distribute the current.
Transfer rates .................................... Up to 780 kbytes/s
Note:
Power Requirement
+5 VDC (10%) ................................ 0.45 A typ, 1 A max
Physical
Dimensions ....................................... 16.5 by 9.9 cm (6.5 by 3.9 in.)
I/O connector .................................... 100-pin male, ribbon-cable
Environment
Operating temperature ....................... 0 to 70 C
Storage temperature........................... -55 to 150 C
Relative humidity .............................. 5% to 90% noncondensing
A-2
Appendix
B-1
Appendix
This appendix contains the manufacturer data sheet for the OKI 82C53*
integrated circuit (OKI Semiconductor). This circuit is used on the
PC-DIO-96/PnP board.
C-1
Appendix
Register-Level
Programming
This appendix describes in detail the address and function of each of the
PC-DIO-96/PnP control and status registers. This appendix also
includes important information about register-level programming on
the PC-DIO-96/PnP along with program examples written in C and
assembly language.
Note:
Introduction
Note:
You can configure your PC-DIO-96/PnP board to use base addresses in the
range of 100 to 3E0 hex. Your PC-DIO-96/PnP board occupies 16 bytes of
address space and must be located on a 16-byte boundary. Therefore, valid
addresses include 100, 110, 120..., 3E0 hex. The base I/O address is
software configured and does not require you to manually change any
settings on the board. For more information on configuring the
PC-DIO-96PnP, see Chapter 2, Installation and Configuration.
The three 8-bit ports of the 82C55A are divided into two groups of 12
signals each: group A and group B. One 8-bit control word selects the
mode of operation for each group. The group A control bits configure
port A (A7 through A0) and the upper 4 bits (nibble) of port C (C7
through C4). The group B control bits configure port B (B7 through B0)
and the lower nibble of port C (C3 through C0). These configuration
bits are defined in the Register Description for the 82C55A section later
in this appendix. Because there are four 82C55A PPI devices on the
board, they are referenced as PPI A, PPI B, PPI C, and PPI D when
differentiation is required.
The three 16-bit counters of the 82C53 are accessed through individual
data ports and controlled by one 8-bit control word. The control word
selects how the counter data ports are accessed and what mode the
D-1
Appendix D
Register-Level Programming
Register Map
The following table lists the address map for the PC-DIO-96/PnP.
Table D-1.
Register Name
Offset Address
(Hex)
Size
Type
PORTA Register
00
8-bit
Read-and-write
PORTB Register
01
8-bit
Read-and-write
PORTC Register
02
8-bit
Read-and-write
CNFG Register
03
8-bit
Write-only
PORTA Register
04
8-bit
Read-and-write
PORTB Register
05
8-bit
Read-and-write
PORTC Register
06
8-bit
Read-and-write
CNFG Register
07
8-bit
Write-only
PPI B
D-2
Appendix D
Table D-1.
Register Name
Register-Level Programming
Offset Address
(Hex)
Size
Type
PORTA Register
08
8-bit
Read-and-write
PORTB Register
09
8-bit
Read-and-write
PORTC Register
0A
8-bit
Read-and-write
CNFG Register
0B
8-bit
Write-only
PORTA Register
0C
8-bit
Read-and-write
PORTB Register
0D
8-bit
Read-and-write
PORTC Register
0E
8-bit
Read-and-write
CNFG Register
0F
8-bit
Write-only
PORTA Register
10
8-bit
Read-and-write
PORTB Register
11
8-bit
Read-and-write
PORTC Register
12
8-bit
Read-and-write
CNFG Register
13
8-bit
Write-only
Register 1
14
8-bit
Write-only
Register 2
15
8-bit
Write-only
PPI C
PPI D
D-3
Appendix D
Register-Level Programming
Register Descriptions
The register descriptions for the devices on the PC-DIO-96/PnP,
including the 82C55A, the 82C53, and each of the interrupt control
registers, are given on the pages that follow.
D-4
Appendix D
Group A
D7
D6
D5
Register-Level Programming
Group B
D4
D3
D2
D1
D0
Control Word
Flag
Port C
(low nibble)
1 = input
0 = output
1 = mode set
Mode Selection
00 = mode 0
01 = mode 1
1X = mode 2
Port B
1 = input
0 = output
Mode Selection
0 = mode 0
1 = mode 1
Port A
1 = input
0 = output
Port C
(high nibble)
1 = input
0 = output
D7
D6
D5
D3
D4
D2
D1
Control Word
Flag
0 = bit set/reset
D0
Bit Set/Reset
1 = set
0 = reset
Bit Select
(000)
(001)
(010)
:
:
(111)
Unused
Warning: During programming, note that each time a port is configured, output
ports A and C are reset to 0, and output port B is undefined.
D-5
Appendix D
Register-Level Programming
Table D-2 shows the control words for setting or resetting each bit in
port C. Notice that bit 7 of the control word is cleared when
programming the set/reset option for the bits of port C.
Table D-2.
Bit Number
Bit Reset
Control Word
0xxx0001
0xxx0000
xxxxxxxb
0xxx0011
0xxx0010
xxxxxxbx
0xxx0101
0xxx0100
xxxxxbxx
0xxx0111
0xxx0110
xxxxbxxx
0xxx1001
0xxx1000
xxxbxxxx
0xxx1011
0xxx1010
xxbxxxxx
0xxx1101
0xxx1100
xbxxxxxx
0xxx1111
0xxx1110
bxxxxxxx
D-6
Appendix D
D7
D6
D5
D4
D3
D2
D1
Register-Level Programming
D0
BCD
1 = count in BCD
0 = count in binary
Counter Select
00 = counter 0
01 = counter 1
10 = counter 2
11 = illegal
Access Mode
00 = latch counter value
01 = access LSB only
10 = access MSB only
11 = access LSB, then MSB
Mode Select
000 = mode 0
001 = mode 1
010 = mode 2
011 = mode 3
100 = mode 4
101 = mode 5
110 = mode 2
111 = mode 3
D-7
Appendix D
Register-Level Programming
D6
D5
D4
D3
D2
D1
D0
DIRQ1
DIRQ0
CIRQ1
CIRQ0
BIRQ1
BIRQ0
AIRQ1
AIRQ0
Bit
Name
Description
DIRQ1
PPI D Interrupt Request for Port BIf this bit and the
INTEN bit in Interrupt Control Register 2 are both set,
PPI D sends an interrupt, INTRB, to the host
computer. If this bit is cleared, PPI D does not send
the interrupt INTRB to the host computer, regardless
of the setting of INTEN.
DIRQ0
PPI D Interrupt Request for Port AIf this bit and the
INTEN bit in Interrupt Control Register 2 are both set,
PPI D sends an interrupt, INTRA, to the host
computer. If this bit is cleared, PPI D does not send
the interrupt INTRA to the host computer, regardless
of the setting of INTEN.
CIRQ1
PPI C Interrupt Request for Port BIf this bit and the
INTEN bit in Interrupt Control Register 2 are both set,
PPI C sends an interrupt, INTRB, to the host
computer. If this bit is cleared, PPI C does not send the
interrupt INTRB to the host computer, regardless of
the setting of INTEN.
CIRQ0
PPI C Interrupt Request for Port AIf this bit and the
INTEN bit in Interrupt Control Register 2 are both set,
PPI C sends an interrupt, INTRA, to the host
computer. If this bit is cleared, PPI C does not send the
interrupt INTRA to the host computer, regardless of
the setting of INTEN.
BIRQ1
PPI B Interrupt Request for Port BIf this bit and the
INTEN bit in Interrupt Control Register 2 are both set,
PPI B sends an interrupt, INTRB, to the host
computer. If this bit is cleared, PPI B does not send the
interrupt INTRB to the host computer, regardless of
the setting of INTEN.
D-8
Appendix D
Register-Level Programming
Bit
Name
Description (Continued)
BIRQ0
PPI B Interrupt Request for Port AIf this bit and the
INTEN bit in Interrupt Control Register 2 are both set,
PPI B sends an interrupt, INTRA, to the host
computer. If this bit is cleared, PPI B does not send the
interrupt INTRA to the host computer, regardless of
the setting of INTEN.
AIRQ1
PPI A Interrupt Request for Port BIf this bit and the
INTEN bit in Interrupt Control Register 2 are both set,
PPI A sends an interrupt, INTRB, to the host
computer. If this bit is cleared, PPI A does not send
the interrupt INTRB to the host computer, regardless
of the setting of INTEN.
AIRQ0
PPI A Interrupt Request for Port AIf this bit and the
INTEN bit in Interrupt Control Register 2 are both set,
PPI A sends an interrupt, INTRA, to the host
computer. If this bit is cleared, PPI A does not send
the interrupt INTRA to the host computer, regardless
of the setting of INTEN.
D-9
Appendix D
Register-Level Programming
D6
D5
D4
D3
D2
D1
D0
INTEN
CTRIRQ
CTR1
Bit
Name
Description
73
INTEN
CTRIRQ
CTR1
D-10
Appendix D
Register-Level Programming
The 82C55A also has a single bit set/reset feature for port C, which is
programmed by the 8-bit control word. For additional information, refer
to Appendix B, OKI 82C55A Data Sheet.
Mode 0
This mode can be used for simple input and output operations for each
of the ports. No handshaking is required; data is simply written to or
read from a specified port.
Mode 0 has the following features:
Two 8-bit ports (A and B) and two 4-bit ports (upper and lower
nibbles of port C).
Mode 1
This mode transfers data that is synchronized by handshaking signals.
Ports A and B use the eight lines of port C to generate or receive the
handshake signals. This mode divides the ports into two groups
(group A and group B) and includes the following features:
Each group contains one 8-bit data port (port A or port B) and one
4-bit control/data port (upper or lower nibble of port C).
The 8-bit data ports can be either input or output, both of which are
latched.
The 4-bit ports are used for control and status of the 8-bit data ports.
D-11
Appendix D
Register-Level Programming
Mode 2
This mode can be used for communication over a bidirectional 8-bit
bus. Handshaking signals are used in a manner similar to mode 1.
Mode 2 is available for use in group A only (port A and the upper nibble
of port C). Other features of this mode include the following:
Control Word
Group A
Group B
C1
Port B
Port C2
Number
Bit
76543210
Port A
Port
10000000
Output
Output
Output
Output
10000001
Output
Output
Output
Input
10000010
Output
Output
Input
Output
10000011
Output
Output
Input
Input
10001000
Output
Input
Output
Output
10001001
Output
Input
Output
Input
10001010
Output
Input
Input
Output
10001011
Output
Input
Input
Input
10010000
Input
Output
Output
Output
D-12
Appendix D
Table D-3.
Register-Level Programming
Control Word
Group A
Group B
Number
Bit
76543210
Port A
Port C1
Port B
Port C2
10010001
Input
Output
Output
Input
10
10010010
Input
Output
Input
Output
11
10010011
Input
Output
Input
Input
12
10011000
Input
Input
Output
Output
13
10011001
Input
Input
Output
Input
14
10011010
Input
Input
Input
Output
15
10011011
Input
Input
Input
Input
1Upper
2Lower
nibble of port C
nibble of port C
BASE_ADDRESS
APORTAoffset
APORTBoffset
APORTCoffset
ACNFGoffset
0x180
0x00
0x01
0x02
0x03
/*
/*
/*
/*
/*
addresses */
APORTAoffset;
APORTBoffset;
APORTCoffset;
ACNFGoffset;
D-13
Appendix D
Register-Level Programming
/* EXAMPLE 1*/
outp(cnfg,0x80);
outp(porta,0x12);
outp(portb,0x34);
outp(portc,0x56);
/*
/*
/*
/*
Ports
Write
Write
Write
A, B, and C are
data to port A.
data to port B.
data to port C.
outputs. */
*/
*/
*/
/*
/*
/*
/*
/* EXAMPLE 2*/
outp(cnfg,0x90);
outp(portb,0x22);
outp(portc,0x55);
valread = inp(porta);
/* EXAMPLE 3 */
outp(cnfg,0x82);
/* EXAMPLE 4 */
outp(cnfg,0x89);
D-14
Appendix D
Register-Level Programming
D7
D6
D5
D4
D3
D2
D1
D0
1/0
The control word written to the CNFG Register to configure port B for
input in mode 1 is shown as follows. Notice that port B does not have
extra input or output lines from port C.
D7
D6
D5
D4
D3
D2
D1
D0
During a mode 1 data read transfer, the status of the handshaking lines
and interrupt signals can be obtained by reading port C. The port C
status-word bit definitions for an input transfer are shown as follows.
Port C status-word bit definitions for input (port A and port B):
D7
D6
D5
D4
D3
D2
D1
D0
I/O
I/O
IBFA
INTEA
INTRA
INTEB
IBFB
INTRB
Bit
Name
Description
76
I/O
Input/OutputThese bits can be used for generalpurpose I/O when port A is in mode 1 input. If these
bits are configured for output, the port C bit set/reset
function must be used to manipulate them.
IBFA
INTEA
INTRA
D-15
Appendix D
Register-Level Programming
Bit
Name
Description (Continued)
INTEB
IBFB
INTRB
At the digital I/O connector, port C has the following pin assignments
when in mode 1 input. Notice that the status of STBA* and the status of
STBB* are not included in the port C status word.
Group A
Group B
PC7
I/O
PC6
I/O
PC5
IBFA
PC4
STBA*
PC3
INTRA
PC2
STBB*
PC1
IBFB
PC0
INTRB
BASE_ADDRESS
APORTAoffset
APORTBoffset
APORTCoffset
ACNFGoffset
0x180
0x00
0x01
0x02
0x03
/*
/*
/*
/*
/*
D-16
Appendix D
Register-Level Programming
porta
portb
portc
cnfg
=
=
=
=
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
+
+
+
+
APORTAoffset;
APORTBoffset;
APORTCoffset;
ACNFGoffset;
valread = inp(porta);
/* EXAMPLE 2Port B input */
outp(cnfg,0x86);
while (!(inp(portc) & 0x02));
valread = inp(portb);
}
D6
D5
D4
D3
D2
D1
D0
1/0
The control word written to the CNFG Register to configure port B for
output in mode 1 is shown as follows. Notice that port B does not have
extra input or output lines from port C.
D-17
Appendix D
Register-Level Programming
D7
D6
D5
D4
D3
D2
D1
D0
During a mode 1 data write transfer, the status of the handshaking lines
and interrupt signals can be obtained by reading port C. Notice that the
bit definitions are different for a write and a read transfer.
Port C status-word bit definitions for output (port A and port B):
D7
D6
D5
D4
D3
D2
D1
D0
OBFA*
INTEA
I/O
I/O
INTRA
INTEB
OBFB*
INTRB
Bit
Name
Description
OBFA*
INTEA
54
I/O
Input/OutputThese bits can be used for generalpurpose I/O when port A is in mode 1 output. If these
bits are configured for output, the port C bit set/reset
function must be used to manipulate them.
INTRA
INTEB
OBFB*
INTRB
D-18
Appendix D
Register-Level Programming
At the digital I/O connector, port C has the following pin assignments
when in mode 1 output. Notice that the status of ACKA* and the status
of ACKB* are not included when port C is read.
Group A
Group B
PC7
OBFA*
PC6
ACKA*
PC5
I/O
PC4
I/O
PC3
INTRA
PC2
ACKB*
PC1
OBFB*
PC0
INTRB
BASE_ADDRESS
APORTAoffset
APORTBoffset
APORTCoffset
ACNFGoffset
0x180
0x00
0x01
0x02
0x03
/*
/*
/*
/*
/*
porta
portb
portc
cnfg
=
=
=
=
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
+
+
+
+
APORTAoffset;
APORTBoffset;
APORTCoffset;
ACNFGoffset;
D-19
Appendix D
Register-Level Programming
outp(porta,0x12);
/* EXAMPLE 2port B output */
outp(cnfg,0x84);
while (!(inp(portc) & 0x02));
outp(portb,0x34);
}
D-20
Appendix D
Register-Level Programming
D6
D5
D4
D3
D2
D1
D0
1/0
1/0
1/0
Port C
(PC2-PC0)
1 = input
0 = output
Port B
1 = input
0 = output
Group B Mode
0 = mode 0
1 = mode 1
During a mode 2 data transfer, the status of the handshaking lines and
interrupt signals can be obtained by reading port C. The port C statusword bit definitions for a mode 2 transfer are shown as follows.
D-21
Appendix D
Register-Level Programming
D6
D5
D4
D3
D2
D1
D0
OBFA*
INTE1
IBFA
INTE2
INTRA
I/O
I/O
I/O
Bit
Name
Description
OBFA*
INTE1
IBFA
INTE2
INTRA
20
I/O
Input/OutputThese bits can be used for generalpurpose I/O lines if group B is configured for mode 0.
If group B is configured for mode 1, refer to the bit
explanations shown in the preceding mode 1 sections.
D-22
Appendix D
Register-Level Programming
At the digital I/O connector, port C has the following pin assignments
when in mode 2. Notice that the status of STBA* and the status of
ACKA* are not included in the port C status word.
Group A
Group B
PC7
OBFA*
PC6
ACKA*
PC5
IBFA
PC4
STBA*
PC3
INTRA
PC2
PC1
PC0
# The three port C lines associated with group B function are based on the
mode selected for group B; that is, if group B is configured for mode 0,
PC2-PC0 function as general-purpose input/output, but if group B is
configured for mode 1 input or output, PC2-PC0 function as handshaking
lines as shown in the preceding mode 1 sections.
Figure D-6. Port C Pin Assignments, Mode 2
BASE_ADDRESS
APORTAoffset
APORTBoffset
APORTCoffset
ACNFGoffset
0x180
0x00
0x01
0x02
0x03
/*
/*
/*
/*
/*
D-23
Appendix D
/*
Register-Level Programming
porta
portb
portc
cnfg
=
=
=
=
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
+
+
+
+
APORTAoffset;
APORTBoffset;
APORTCoffset;
ACNFGoffset;
/* EXAMPLE 1*/
outp(cnfg,0xC0);
while (!(inp(portc) & 0x80));
/* Port A is in mode 2. */
/* Wait until OBFA* is set,
indicating that the data last
written to port A has been read.
*/
/* Write the data to port A. */
/* Wait until IBFA is set,
indicating that data is
available in port A to be read.
*/
/* Read data from port A. */
outp(porta,0x67);
while (!(inp(portc) & 0x20));
valread = inp(porta);
}
BASE_ADDRESS
APORTAoffset
APORTBoffset
APORTCoffset
0x180
0x00
0x01
0x02
/*
/*
/*
/*
D-24
180 */
*/
*/
*/
Appendix D
#define ACNFGoffset
#define IREG1offset
#define IREG2offset
0x03
0x14
0x15
Register-Level Programming
porta
portb
portc
cnfg
ireg1
ireg2
=
=
=
=
=
=
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
+
+
+
+
+
+
APORTAoffset;
APORTBoffset;
APORTCoffset;
ACNFGoffset;
IREG1offset;
IREG2offset;
/* EXAMPLE 1Set up interrupts for mode 1 input for port A. Enable the
appropriate interrupt bits. */
outp(cnfg,0xB0);
outp(cnfg,0x09);
outp(ireg1,0x01);
outp(ireg2,0x04);
/*
/*
/*
/*
/* EXAMPLE 2Set up interrupts for mode 1 input for port B. Enable the
appropriate interrupt bits. */
outp(cnfg,0x86);
outp(cnfg,0x05);
outp(ireg1,0x02);
outp(ireg2,0x04);
/*
/*
/*
/*
/* EXAMPLE 3Set up interrupts for mode 1 output for port A. Enable the
appropriate interrupt bits. */
outp(cnfg,0xA0);
outp(cnfg,0x0D);
outp(ireg1,0x01);
outp(ireg2,0x04);
/*
/*
/*
/*
/* EXAMPLE 4Set up interrupts for mode 1 output for port B. Enable the
appropriate interrupt bits. */
outp(cnfg,0x84);
outp(cnfg,0x05);
outp(ireg1,0x02);
outp(ireg2,0x04);
/*
/*
/*
/*
D-25
Appendix D
Register-Level Programming
/*
/*
/*
/*
Mode 2 output. */
Set PC6 to enable interrupts from 82C55A. */
Set AIRQ0 to enable PPI A, port A interrupts. */
Set INTEN bit. */
/*
/*
/*
/*
Mode 2 input. */
Set PC4 to enable interrupts from 82C55A. */
Set AIRQ0 to enable PPI A, port A interrupts. */
Set INTEN bit. */
General Information
The 82C53 contains three counter/timers, each of which can operate in
one of six different modes. As the PC-DIO-96/PnP is designed,
however, only counter 0 and counter 1 are configured for operation;
counter 2 is not connected, nor is it available on the external I/O
connector. In addition, counter 0 and counter 1 are wired to the interrupt
circuitry in such a way that only four of the modes are available for use.
The source for counter 0 is a 2 MHz clock. If counter 0 is used for
interrupting the host computer, configure the counter for rate
generation, or mode 2. If counter 1 is used for interrupting the host
computer, counter 0 is used as a frequency scaler which feeds the source
input for counter 1. In this case, configure both counters for rate
generation, or mode 2. To determine the time between pulses generated
by counter 0, multiply the load value by 500 ns (1/(2 MHz)). To
determine the time between pulses generated by counter 1, multiply the
load value by the time between pulses of counter 0. A sample
configuration procedure is presented in the next section.
D-26
Appendix D
Register-Level Programming
BASE_ADDRESS
CTR0offset
CTR1offset
CTRCNFGoffset
IREG1offset
IREG2offset
0x180
0x10
0x11
0x13
0x14
0x15
/*
/*
/*
/*
/*
/*
#define channel
#define use_ctr1
#define ctr0_data
#define ctr1_data
0
10000
1000
ctr0
ctr1
cnfg
ireg1
ireg2
=
=
=
=
=
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
BASE_ADDRESS
+
+
+
+
+
CTR0offset;
CTR1offset;
CTRCNFGoffset;
IREG1offset;
IREG2offset;
/* Disable interrupts */
outp(ireg1,0x00);
outp(ireg2,0x00);
/* Set up the counter modes--do not write out the counter load values at this
time, as this starts the counter. */
outp(cnfg,0x34);
if (use_ctr1) {
outp(cnfg,0x74);
outp(ireg2,0x07);
}
else outp(ireg2, 0x06);
/* At this point, you should install your interrupt service routine using the
interrupt channel selected. */
/* install_isr(channel,...); */
D-27
Appendix D
Register-Level Programming
/* Now write out the counter load values for the selected counters. */
if (use_ctr1) {
outp(ctr1, ((unsigned char) (ctr1_data & 0x00ff)));
/* Send the least significant byte of
data for counter 1 */
outp(ctr1, ((unsigned char) ((ctr1_data & 0xff00) >> 8)));
/* Send the most significant byte of
data for counter 1 */
}
outp(ctr0, ((unsigned char) (ctr0_data & 0x00ff)));
/* Send the least significant byte of
data for counter 0 */
outp(ctr0, ((unsigned char) ((ctr0_data & 0xff00) >> 8)));
/* Send the most significant byte of
data for counter 0 */
the counter
the counter
the counter
the counter
/* After you have deactivated interrupts, you must remove your interrupt
service routine before exiting your program--do this now. */
/* remove_isr(); */
D-28
Appendix D
Register-Level Programming
; declarations
ackm
acks
eoi
maskm
masks
equ
equ
equ
equ
equ
00020h
000a0h
00020h
00021h
000a1h
int_addr
int_mask
isrb_addr
slave_ack
vect_num
dd
dw
dd
db
db
0
0
0
0
0
_DATA
ends
D-29
Appendix D
_TEXT
;
;
;
;
;
;
;
;
;
Register-Level Programming
install_isr
bp reg
ret addr ofs
ret addr seg
level
isr_block ofs
isr_block seg
_install_isr
at
at
at
at
at
at
[bp+0]
[bp+2]
[bp+4]
[bp+6]
[bp+8]
[bp+10]
proc
cli
push
mov
push
push
push
push
push
push
mov
mov
far
bp
bp,sp
ax
bx
cx
dx
ds
es
ax,seg _DATA
ds,ax
; set interrupt vector--save the current vector before writing out new one
mov
cmp
ja
add
jmp
ax,[bp+6]
al,7
short slave
al,008h
short setvec
;
;
;
;
;
D-30
Appendix D
Register-Level Programming
slave:
add
mov
al,068h
slave_ack,1
push
mov
int
pop
mov
mov
cmp
jne
cmp
je
ax
; Save vector number for later
ah,35h
; Get current vector
21h
; Get previous int_addr in es:bx
ax
; Restore vector number
cx,cs
; Prep to compare current/new vectors
dx,es
dx,cx
; See if vector is already there
short ii_0
bx,offset _isr_handler
short ii_exit
; Vector already installed--exit
mov
mov
mov
push
mov
mov
mov
int
pop
vect_num,al
; Save vector number for remove_isr
word ptr int_addr[0],bx ; Save the address
word ptr int_addr[2],es
ds
; Save the data segment
ds,cx
; Copy cx (== cs) into ds
dx,offset _isr_handler
; ds:dx points to new handler
ah,25h
21h
; Install the handler in the system
ds
setvec:
ii_0:
cx,[bp+6]
bx,1
bx,cl
cx,bx
bx
al,maskm
$+2
cl,al
al,bl
maskm,al
$+2
al,masks
$+2
ch,al
;
;
;
;
D-31
Appendix D
Register-Level Programming
and
out
mov
al,bh
masks,al
int_mask,cx
;
;
;
;
;
;
es
ds
dx
cx
bx
ax
bp
endp
remove_isr
bp reg
ret addr ofs
ret addr seg
_remove_isr
proc
cli
push
push
push
push
push
push
mov
mov
at [bp+0]
at [bp+2]
at [bp+4]
far
ax
bx
cx
dx
ds
es
ax,seg _DATA
ds,ax
D-32
Appendix D
Register-Level Programming
vect_num,0
; See if vect_num was ever set
short ri_exit
; Our vector never installed--exit
al,vect_num
; Get vector number
ah,35h
; Get current vector from DOS
21h
; Get previous int_addr in es:bx
cx,cs
; Prep to compare old/current vectors
dx,es
dx,cx
; See if our vector is already there
short ri_exit
; Different vector segment--exit
bx,offset _isr_handler
short ri_exit
; Different vector offset--exit
;
;
;
;
;
;
;
;
;
;
;
;
D-33
Appendix D
Register-Level Programming
es
ds
dx
cx
bx
ax
; isr_handler
;
_isr_handler proc
cli
push
push
far
ax
ds
; service interrupt
; Your code here...
;
if this was not your interrupt, jump to 'ih_0'
;
if this was your interrupt, service it as appropriate;
;
the pointer for the data structure 'isr_block' is stored
;
at _DATA:isrb_addr; to access the structure, use the
;
following steps:
;
;
mov
ax,seg _DATA
;
mov
ds,ax
;
lds
si,isrb_addr
;
;
you need not use ds:si, but be sure to save any
;
registers you use...
D-34
Appendix D
Register-Level Programming
ax,seg _DATA
ds,ax
al,eoi
slave_ack,0
short ih_1
acks,al
$+2
out
ackm,al
ih_1:
; Send master acknowledge
ds
ax
_isr_handler
_TEXT
endp
ends
end
Interrupt Handling
The INTEN bit of Interrupt Register 2 must be set to enable interrupts
from the PC-DIO-96/PnP. This bit must first be cleared to disable
unwanted interrupts. After all sources of interrupts have been disabled
or placed in an inactive state, you can set INTEN.
To interrupt the host computer using one of the 82C55A devices,
program the selected 82C55A for the I/O mode desired. In mode 1, set
either the INTEA or the INTEB bit to enable interrupts from port A or
port B, respectively. In mode 2, set either INTE1 or INTE2 for
interrupts on output or input transfers, respectively. The INTE1 and
INTE2 interrupt outputs are cascaded into a single interrupt output for
port A. After interrupts have been enabled from the 82C55A, set the
appropriate enable bit for the selected 82C55A; for example, if you
selected both mode 2 interrupts for PPI C, you would set CIRQ0 in
order to interrupt the host computer.
National Instruments Corporation
D-35
Appendix D
Register-Level Programming
To interrupt the host computer using one of the 82C53 counter outputs,
program the counter(s) as described in the section, Interrupt
Programming Example for the 82C53, of this chapter.
External signals can be used to interrupt the PC-DIO-96/PnP when
port A or port B is in mode 0 and the low nibble of port C is configured
for input. If port A is in mode 0, use PC3 to generate an interrupt; if
port B is in mode 0, use PC0 to generate an interrupt. Once you have
configured the selected 82C55A, you must set the corresponding
interrupt enable bit in Interrupt Register 1. If you are using PC3, set
xIRQ0; if you are using PC0, set xIRQ1. When the external signal
becomes logic high, an interrupt request occurs. Although the host
computers interrupt-monitoring circuitry is triggered by the positivegoing edge of the interrupt signal, the signal must remain high until the
interrupt routine has been entered and interrupts have been masked out.
Make sure your external interrupt signal meets these qualifications. To
disable the external interrupt, clear the appropriate xIRQy bit or clear
the INTEN bit.
D-36
Appendix
Comparison of Characteristics
Functional Changes
Legacy PC-DIO-96
Revised PC-DIO-96
Assembly number
181170B-01
183549X-02
183549X-01
Uses switches
Uses switches
Interrupt request
selection
Uses jumpers
Uses jumpers
5 V supply fuse
Nonresettable
Self-resetting
Self-resetting
Power-up state
E-1
PC-DIO-96PnP
Appendix E
Port A 8
82C55A PPI
Port B 8
Port C 8
Port A 8
21
Data
Transceiver
82C55A PPI
Port B 8
Port C 8
Port A 8
PC I/O
Channel
Control
82C55A PPI
Port B 8
Port C 8
Port A 8
Interrupt
Control
Circuitry
82C55A PPI
I/O Connector
PC I/O Channel
Port B 8
Port C 8
82C53 Timer
+5 VDC
1 A Fuse
Board Configuration
The PC-DIO-96 contains one jumper and one DIP switch to configure
the PC bus interface settings. The DIP switch U16 sets the base I/O
address. Jumper W2 selects the interrupt level. The DIP switch and
jumper are shown in the parts locator diagram in Figure E-2.
E-2
Appendix E
2
1
2
W2
U16
1
3
4
Serial Number
W1
5
6
J1
F1
E-3
Appendix E
PC-DIO-96
Board
Base I/O
Address
Default Settings
Hardware Implementation
Hex 180
(factory setting)
U16
A8
A7
A6
A5
Interrupt
Level
OFF
A9
W2: Row 5
E-4
Appendix E
The base I/O address for the PC-DIO-96 is determined by the switches
at position U16 (see Figure E-2). The switches are set at the factory for
the I/O address hex 180. With this default setting, the PC-DIO-96 uses
the I/O address space hex 180 through 19F.
Note:
Verify that this space is not already used by other equipment installed in
your computer. If any equipment in your computer uses this I/O address
space, you must change the base I/O address for the PC-DIO-96 or for the
other device.
Each switch in U16 corresponds to one of the address lines A9 through
A5. Thus, the range for possible base I/O address settings is hex 000
through 3E0. Base I/O address values hex 000 through 0FF are reserved
for system use. Base I/O values hex 100 through 3FF are available on
the I/O channel. A4, A3, A2, A1, and A0 are used by the PC-DIO-96 to
decode accesses to the onboard registers. On the U16 DIP switch, press
the side marked OFF to select a binary value of 1 for the corresponding
address bit. Press the other side of the switch to select a binary value of
0 for the corresponding address bit. Figure E-3 shows two possible
switch settings. The black side indicates the side of the switch that is
pushed down.
E-5
Appendix E
U16
1
OFF
A9
A8
A7
A6
A5
OFF
A9
A8
A7
A6
A5
Table E-3 shows all possible switch settings and their corresponding
address ranges.
E-6
Appendix E
Table E-3.
Switch Setting
A9 A8 A7 A6 A5
Base I/O
Address (hex)
000
00001F
020
02003F
040
04005F
060
06007F
080
08009F
0A0
0A00BF
0C0
0C00DF
0E0
0E00FF
100
10011F
120
12013F
140
14015F
160
16017F
180
18019F
1A0
1A01BF
1C0
1C01DF
1E0
1E01FF
200
20021F
220
22023F
240
24025F
260
26027F
280
28029F
2A0
2A02BF
2C0
2C02DF
2E0
2E02FF
300
30031F
E-7
Appendix E
Table E-3.
Switch Setting
A9 A8 A7 A6 A5
Base I/O
Address (hex)
320
32033F
340
34035F
360
36037F
380
38039F
3A0
3A03BF
3C0
3C03DF
3E0
3E03FF
Note:
Base I/O address values 000 through 0FF hex are reserved
for system use. Base I/O address values 100 through 3FF
hex are available on the I/O channel.
Interrupt Selection
There is one set of jumpers for interrupt selection on the PC-DIO-96
board. Use W2 for selecting the interrupt level. The location of this
jumper is shown in Figure E-2.
The PC-DIO-96 board can connect to any one of six interrupt lines of
the PC I/O Channel: IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, or IRQ9. Select
the interrupt line by setting a jumper on W2. The default interrupt line
is IRQ5. To change to another line, remove the jumper from IRQ5 and
place it on the pins for another request line. Figure E-4 shows the
default factory setting for IRQ5.
E-8
Appendix E
W2
IRQ9
IRQ7
IRQ6
IRQ5
IRQ4
IRQ3
The PC-DIO-96 can share interrupt lines with other devices because it
uses a tri-state driver to drive its selected interrupt line. For information
on how to disable this driver, see Appendix D, Register-Level
Programming.
Installation
You can install the PC-DIO-96 in any unused 8-bit, 16-bit, or 32-bit
expansion slot in your computer. To optimize the boards noise
performance, install the board away from the video card and leave a slot
vacant on each side of the PC-DIO-96, if possible. After you make any
necessary changes and verify the switch and jumper settings, record
them using the PC-DIO-96/PnP Hardware and Software Configuration
Form in Appendix F, Customer Communication. You are now ready to
install the PC-DIO-96.
The following are general installation instructions, but consult your
computers user manual or technical reference manual for specific
instructions and warnings. If you want to install this board in an EISAclass computer, you can obtain a configuration file for the board by
contacting National Instruments.
1.
2.
3.
4.
5.
E-9
Appendix E
Note:
6.
7.
E-10
Appendix
Customer Communication
For your convenience, this appendix contains forms to help you gather the information necessary
to help us solve your technical problems and a form you can use to comment on the product
documentation. When you contact us, we need the information on the Technical Support Form
and the configuration form, if your manual contains one, about your system configuration to
answer your questions as quickly as possible.
National Instruments has technical assistance through electronic, fax, and telephone systems to
quickly provide the information you need. Our electronic services include a bulletin board
service, an FTP site, a FaxBack system, and e-mail support. If you have a hardware or software
problem, first try the electronic support systems. If the information available on these systems
does not answer your questions, we offer fax and telephone support through our technical support
centers, which are staffed by applications engineers.
Electronic Services
Bulletin Board Support
National Instruments has BBS and FTP sites dedicated for 24-hour support with a collection of
files and documents to answer most common customer questions. From these sites, you can also
download the latest instrument drivers, updates, and example programs. For recorded instructions
on how to use the bulletin board and FTP services and for BBS automated information, call
(512) 795-6990. You can access these services at:
United States: (512) 794-5422 or (800) 327-3077
Up to 14,400 baud, 8 data bits, 1 stop bit, no parity
United Kingdom: 01635 551422
Up to 9,600 baud, 8 data bits, 1 stop bit, no parity
France: 1 48 65 15 59
Up to 9,600 baud, 8 data bits, 1 stop bit, no parity
FTP Support
To access our FTP site, log on to our Internet host, ftp.natinst.com, as anonymous and use
your Internet address, such as joesmith@anywhere.com, as your password. The support files
and documents are located in the /support directories.
F-1
FaxBack Support
FaxBack is a 24-hour information retrieval system containing a library of documents on a wide
range of technical information. You can access FaxBack from a touch-tone telephone at
(512) 418-1111.
Telephone
Australia
Austria
Belgium
Canada (Ontario)
Canada (Quebec)
Denmark
Finland
France
Germany
Hong Kong
Israel
Italy
Japan
Korea
Mexico
Netherlands
Norway
Singapore
Spain
Sweden
Switzerland
Taiwan
U.K.
03 9879 5166
0662 45 79 90 0
02 757 00 20
905 785 0085
514 694 8521
45 76 26 00
90 527 2321
01 48 14 24 24
089 741 31 30
2645 3186
03 5734815
02 413091
03 5472 2970
02 596 7456
95 800 010 0793
0348 433466
32 84 84 00
2265886
91 640 0085
08 730 49 70
056 200 51 51
02 377 1200
01635 523545
Fax
03 9879 6277
0662 45 79 90 19
02 757 03 11
905 785 0086
514 694 4399
45 76 26 02
90 502 2930
01 48 14 24 14
089 714 60 35
2686 8505
03 5734816
02 41309215
03 5472 2977
02 596 7455
5 520 3282
0348 430673
32 84 86 00
2265887
91 640 0533
08 730 43 70
056 200 51 55
02 737 4644
01635 523154
Brand _____________________________________________
Other Products
Computer make and model ______________________________________________________
Microprocessor _______________________________________________________________
Clock frequency or speed _______________________________________________________
Type of video board installed ____________________________________________________
Operating system version _______________________________________________________
Operating system mode ________________________________________________________
Programming language _________________________________________________________
Programming language version __________________________________________________
Other boards in system _________________________________________________________
Base I/O address of other boards _________________________________________________
DMA channels of other boards __________________________________________________
Interrupt level of other boards ___________________________________________________
Title:
Edition Date:
September 1996
Part Number:
320289C-01
)_____________________________________________________________________
Fax to:
Technical Publications
National Instruments Corporation
(512) 794-5678
Glossary
Prefix
Meaning
Value
n-
nano-
10-9
micro-
10-6
m-
milli-
10-3
k-
kilo-
103
M-
mega-
106
degrees
ohms
percent
+5 V
+5 volt signal
amperes
ACK*
AIRQ0
AIRQ1
APA
APB
APC
BCD
binary-coded decimal
BIRQ0
BIRQ1
G-1
Glossary
BPA
BPB
BPC
Celsius
CIRQ0
CIRQ1
CMOS
CPA
CPB
CPC
CTR1
CTRIRQ
DATA
DIO
digital input/output
DIRQ0
DIRQ1
DMA
DPA
DPB
DPC
EISA
GND
ground
hex
hexadecimal
Hz
hertz
IBF
IBFA
G-2
Glossary
IBFB
in.
inches
INTE1
INTE2
INTEA
INTEB
INTEN
INTR
INTRA
INTRB
I/O
Iout
output current
ISA
kbytes
1,024 bytes
LSB
meters
MB
megabytes of memory
MSB
OBF*
OBFA*
OBFB*
PnP
PPI
RD*
read signal
REXT
external resistance
RL
load resistance
G-3
Glossary
RTSI
seconds
SCXI
STB
TTL
transistor-to-transistor logic
volts
VDC
VEXT
external volt
Vin
volts in
VOH
VOL
WR*
write signal
G-4
Index
Numbers
I -1
Index
ACK* signal
description (table), 3-13
mode 1 output timing (figure), 3-15
mode 2 bidirectional timing (figure), 3-16
AIRQ0 bit, D-9
AIRQ1 bit, D-9
APA<7..0> signal (table), 3-3
APB<7..0> signal (table), 3-3
APC<7..0> signal (table), 3-3
B
base I/O address settings
PC-DIO-96, E-4 to E-8
example settings (figure), E-6
factory settings (figure), E-4
switch settings and corresponding
address ranges (table), E-7 to E-8
verifying usage by other equipment
(note), E-5
PC-DIO-96/PnP, 2-3
programming considerations (note), D-1
BIRQ0, D-9
BIRQ1 bit, D-8
bits
AIRQ0, D-9
AIRQ1, D-9
BIRQ0, D-9
BIRQ1 bit, D-8
CIRQ0, D-8, D-35
CIRQ1, D-8
CTR1, D-10
CTRIRQ, D-10
DIRQ0, D-8
DIRQ1, D-8
IBFA, D-15, D-22
IBFB, D-16
INTE1, D-22, D-35
INTE2, D-22, D-35
INTEA, D-15, D-18, D-35
INTEB, D-16, D-18, D-35
INTEN, D-10, D-35
C
cable assembly connectors, 3-4 to 3-6
pins 1-50 (figure), 3-5
pins 51-100 (figure), 3-6
cabling for PC-DIO-96/PnP, 1-5 to 1-7
CIRQ0 bit
description, D-8
interrupt handling, D-35
CIRQ1 bit, D-8
configuration. See also signal connections.
PC-DIO-96, E-3 to E-9
base I/O address settings, E-4 to E-8
example settings (figure), E-6
programming considerations
(note), D-1
switch settings and
corresponding address ranges
(table), E-7 to E-8
verifying usage by other
equipment (note), E-5
block diagram, E-2
factory-set switch and jumper
settings (table), E-4
interrupt level selection, E-8 to E-9
IRQ5 default setting
(figure), E-9
parts locator diagram, E-3
I -2
Index
E
electronic technical support, F-1 to F-2
e-mail support, F-2
environment specifications, A-2
equipment for PC-DIO-96/PnP, optional, 1-5
DATA signal
description (table), 3-13
mode 1 input timing (figure), 3-14
mode 1 output timing (figure), 3-15
mode 2 bidirectional timing (figure), 3-16
data transceivers, 4-2
digital I/O connector. See also signal
connections.
pin assignments (figure), 3-2
theory of operation, 4-4
digital I/O power-up state selection,
3-9 to 3-12
high DIO power-up state, 3-9 to 3-10
low DIO power-up state, 3-11 to 3-12
I -3
Index
INTEN bit
description, D-10
interrupt handling, D-35
Interrupt Control Register Group, D-7 to D-10
Interrupt Control Register 1, D-8 to D-9
Interrupt Control Register 2, D-10
overview, D-7
register map, D-3
interrupt handling, D-35 to D-36
interrupt level selection
PC-DIO-96, E-8 to E-9
factory settings (table), E-4
IRQ5 default setting (figure), E-9
PC-DIO-96/PnP, 2-3
interrupt programming examples
82C53 Programmable Interval Timer,
D-27 to D-35
82C55A Programmable Peripheral
Interface, D-23 to D-26
INTR signal
description (table), 3-13
mode 1 input timing (figure), 3-14
mode 1 output timing (figure), 3-15
mode 2 bidirectional timing (figure), 3-16
INTRA bit, Port C status-word definitions
mode 1 strobed input, D-15
mode 1 strobed output, D-18
mode 2 bidirectional data path, D-22
INTRB bit, Port C status-word definitions
mode 1 strobed input, D-16
mode 1 strobed output, D-18
I/O bits, Port C status-word definitions
mode 1 strobed input, D-15
mode 1 strobed output, D-18
mode 2 bidirectional data path, D-22
I/O connector. See digital I/O connector.
H
hardware configuration. See configuration.
high DIO power-up state, 3-9 to 3-10
I
IBF signal
description (table), 3-13
mode 1 input timing (figure), 3-14
mode 2 bidirectional timing (figure), 3-16
IBFA bit, Port C status-word definitions
mode 1 strobed input, D-15
mode 2 bidirectional data path, D-22
IBFB bit, D-16
installation. See also configuration.
PC-DIO-96, E-9 to E-10
PC-DIO-96/PNP
general procedure, 2-2
parts locator diagram, 2-1
unpacking, 1-7
INTE1 bit
interrupt handling, D-35
Port C status-word definitions for
bidirectional data path, D-22
INTE2 bit
interrupt handling, D-35
Port C status-word definitions for
bidirectional data path, D-22
INTEA bit
interrupt handling, D-35
Port C status-word definitions
mode 1 strobed input, D-15
mode 1 strobed output, D-18
INTEB bit
interrupt handling, D-35
Port C status-word definitions
mode 1 strobed input, D-16
mode 1 strobed output, D-18
I -4
Index
L
LabVIEW and LabWindows/CVI application
software, 1-3
low DIO power-up state, 3-11 to 3-12
M
manual. See documentation.
mode 0 operation, 82C55A Programmable
Peripheral Interface
basic I/O, D-12 to D-14
I/O configurations (table), D-12 to D-13
programming example, D-13 to D-14
purpose and use, D-11
mode 1 input timing (figure), 3-14
mode 1 output timing (figure), 3-15
mode 1 strobed input, 82C55A Programmable
Peripheral Interface, D-14 to D-17
control words written to CNFG Register
(figure), D-15
Port C pin assignments (figure), D-16
Port C status-word bit definitions for
input, D-15 to D-16
programming example, D-16 to D-17
purpose and use, D-11
N
NI-DAQ driver software, 1-3 to 1-4
O
OBF* signal
description (table), 3-13
mode 1 output timing (figure), 3-15
mode 2 bidirectional timing (figure), 3-16
OBFA* bit, Port C status-word bit definitions
mode 1 strobed output, D-18
mode 2 bidirectional data path, D-22
OBFB* bit, D-18
OKI 82C53 data sheet, C-1 to C-12
OKI 82C55A data sheet, B-1 to B-17
operation of PC-DIO-96/PnP. See theory of
operation.
optional equipment for PC-DIO-96/PnP, 1-5
output signal specifications, A-2
I -5
Index
R
RD* signal
description (table), 3-13
mode 1 input timing (figure), 3-14
mode 2 bidirectional timing (figure), 3-16
register-level programming, D-1 to D-36. See
also registers.
82C53 Programmable Interval Timer,
D-26 to D-35
general information, D-26
interrupt programming example,
D-27 to D-35
82C55A Programmable Peripheral
Interface, D-11 to D-26
interrupt programming examples,
D-23 to D-26
mode 0 operation
basic I/O, D-12 to D-14
I/O configurations (table),
D-12 to D-13
programming example,
D-13 to D-14
purpose and use, D-11
mode 1 operation, D-11
mode 1 strobed input, D-14 to D-17
control words written to CNFG
Register (figure), D-15
Port C pin assignments
(figure), D-16
Port C status-word bit
definitions for input,
D-15 to D-16
programming example,
D-16 to D-17
I -6
Index
reset
Port C set/reset control words (table), D-6
single-bit reset feature, D-12
S
signal connections, 3-1 to 3-16
cable assembly connectors, 3-4 to 3-6
pins 1-50 (figure), 3-5
pins 51-100 (figure), 3-6
digital I/O power-up state selection
high DIO power-up state, 3-9 to 3-10
low DIO power-up state,
3-11 to 3-12
digital I/O signal connections, 3-7 to 3-8
specifications, 3-7
typical I/O connections (figure), 3-8
exceeding maximum ratings
(warning), 3-1
I/O connector pin assignments
(figure), 3-2
Port C pin assignments, 3-4
power connections, 3-9
signal descriptions (table), 3-8
timing specifications, 3-12 to 3-16
mode 1 input timing, 3-14
mode 1 output timing, 3-15
mode 2 bidirectional timing, 3-16
signals (table), 3-13
single-bit reset feature, 82C55A
Programmable Peripheral Interface, D-12
software programming choices, 1-3 to 1-5
LabVIEW and LabWindows/CVI
application software, 1-3
NI-DAQ driver software, 1-3 to 1-4
register-level programming, 1-5
specifications
digital I/O, A-1 to A-2
digital logic levels, A-1
environment, A-2
physical, A-2
power requirements, A-2
transfer rates, A-2
I -7
Index
WR* signal
description (table), 3-13
mode 1 output timing (figure), 3-15
mode 2 bidirectional timing (figure), 3-16
T
technical support, F-1 to F-2
theory of operation, 4-1 to 4-4
82C53 Programmable Interval Timer, 4-3
82C55A Programmable Peripheral
Interface, 4-3
data transceivers, 4-2
digital I/O connector, 4-4
interrupt control circuitry, 4-2
PC I/O channel control circuitry, 4-2
PC-DIO-96/PnP block diagram, 4-1
Plug and Play circuitry, 4-2
timing specifications, 3-12 to 3-16
mode 1 input timing, 3-14
mode 1 output timing, 3-15
mode 2 bidirectional timing, 3-16
signals (table), 3-13
transfer rate specifications, A-2
I -8