Pci 1751
Pci 1751
Users Manual
Copyright
This documentation and the software included with this product are
copyrighted 1998 by Advantech Co., Ltd. All rights are reserved.
Advantech Co., Ltd. reserves the right to make improvements in the
products described in this manual at any time without notice.
No part of this manual may be reproduced, copied, translated or
transmitted in any form or by any means without the prior written
permission of Advantech Co., Ltd. Information provided in this manual
is intended to be accurate and reliable. However, Advantech Co., Ltd.
assumes no responsibility for its use, nor for any infringements of the
rights of third parties which may result from its use.
Acknowledgments
PC-LabCard is a trademark of Advantech Co., Ltd. IBM and PC are
trademarks of International Business Machines Corporation. MS-DOS
and Windows are trademarks of Microsoft Corporation. Intel and
Pentium are trademarks of Intel Corporation.
CE notification
The PCI-1751, developed by ADVANTECH CO., LTD., has passed the
CE test for environmental specifications when shielded cables are used
for external wiring. We recommend the use of shielded cables. This
kind of cable is available from Advantech. Please contact your local
supplier for ordering information.
CHAPTER
General Information
The PCI-1751 is a 48-bit DI/O and counter/timer card with PCI bus. It
provides you with 48 bits of parallel digital input/output as well as 3
timers. It emulates mode 0 of the 8255 PPI chip, but the buffered
circuits offer a higher driving capability than the 8255.
The card emulates two 8255 PPI chips to provide 48 DI/O bits. The
I/O bits are divided into six 8-bit I/O ports: A0, B0, C0, A1, B1 and C1.
You can configure each port as either input or output via software.
The dual interrupt handling capability provides users the flexibility to
generate interrupts to a PC. A pin in the connector can output a
digital signal simultaneously with the card's generating an interrupt.
This card uses a high density SCSI 68-pin connector for easy and
reliable connections to field devices.
Two other features give the PCI-1751 practical advantages in an
industrial setting. When the system is hot reset (the power is not
turned off) the PCI-1751 retains the last I/O port settings and output
values if the user has set jumper JP4 to enable this feature. Otherwise,
port settings and output values reset to their safe default state, or to
the state determined by other jumper settings. The PCI-1751's other
useful feature is it supports both wet and dry contacts, allowing it to
interface with other devices more easily.
Numbering Convention
All numbers given in this manual are in decimal format unless
specifically noted otherwise. In particular, where a register address is
given as (Base + 32), the decimal number "32" should be added to the
base value.
Features
• 48 TTL level digital I/O lines.
• Emulates mode 0 of 8255 PPI
• Buffered circuits provide higher driving capability
Applications
• Industrial AC/DC I/O devices monitoring and control
• Relay and switch monitoring and control
• Parallel data transfer
• Sensing the signals of TTL, DTL, CMOS logic
• Driving indicator LEDs
Specifications
I/O channels: 48 digital I/O lines
Programming mode: 8255 PPI mode 0
Input Signal
• Logic high voltage: 2.0 to 5.25 V
• Logic low voltage: 0.0 to 0.80 V
• High level input current: 20 µA
• Low level input current: -0.2 mA
Interrupt Source
• PC00, PC04, PC10, PC14, Timer 1 and Counter 2.
Transfer Rate
(This value depends on software and speed of computer.)
• Typical: 1 MB/sec (tested under DOS, Pentium® 100 MHz CPU)
• Maximum: 1.5 MB/sec
Connector: One SCSI-II 68-pin female connector
Power consumption: 5 V @ 850 mA (Typical)
5 V @ 1.0 A (Max.)
Operating temperature: 0 ~ 70º C (32º F ~ 158 ºF)
Storage temperature: -20 ~ 80º C(-4º F ~ 176º F)
Humidity: 5% ~ 95% non-condensing
Dimension: 170 x 100 mm (6.9" x 3.9")
CHAPTER
Installation
Chapter 2 Installation 5
Initial Inspection
Before starting to install the PCI-1751, make sure there is no visible
damage on the card. We carefully inspected the card both mechani-
cally and electrically before shipment. It should be free of marks and
in perfect order on receipt.
As you unpack the PCI-1751, check it for signs of shipping damage
(damaged box, scratches, dents, etc.) If it is damaged or fails to meet
its specifications, notify our service department or your local sales
representative immediately. Also, call the carrier immediately and
retain the shipping carton and packing materials for inspection by the
carrier. We will then make arrangements to repair or replace the unit.
Unpacking
The PCI-1751 contains components that are sensitive and vulnerable
to static electricity. Discharge any static electricity on your body to
ground by touching the back of the system unit (grounded metal)
before you touch the board.
Remove the PCI-1751 card from its protective packaging by grasping
the card's rear panel. Handle the card only by its edges to avoid static
discharge which could damage its integrated circuits. Keep the
antistatic package. Whenever you remove the card from the PC,
please store the card in this package for its protection.
You should also avoid contact with materials that hold static electrici-
ty such as plastic, vinyl and styrofoam.
Check the product contents inside the packing. There should be one
card, one CD-ROM, and this manual. Make sure nothing is missing.
Chapter 2 Installation 7
Using Jumpers to Set Ports as Output Ports
By shorting the lower two pins of the jumpers JPA0, JPB0, JPC0L,
JPC0H, JPA1, JPB1, JPC1L or JPC1H, a user sets the corresponding
ports to be output ports. (JPA0 means jumper for port A0, JPB0
means jumper for port B0, etc.) Shorting the lower two pins of a
port's jumper pins disables the port from being software configurable
as an input port. The initial state of each of these ports after system
power on or reset will be logic 0 (voltage low), unless jumper JP4
determines otherwise. (See Jumper JP4 below.)
N am es o f J u m p er s F u n c t i o n d es c r i p t i o n
1
JP1: Timer 0 Internal counter clock source
JP2: Timer 1
1
All ports return to state held
just prior to reset
Chapter 2 Installation 9
PCI-1751 Block Diagram
Timer 0
Timer 1
Chapter 2 Installation 11
Installation Instructions
The PCI-1751 can be installed in any PCI slot in the computer. Howev-
er, refer to the computer user's manual to avoid any mistakes and
danger before you follow the installation procedure below:
1. Turn off your computer and any accessories connected to the
computer.
2. Disconnect the power cord and any other cables from the back of
the computer.
3. Remove the cover of the computer.
4. Select an empty 5 V PCI slot. Remove the screw that secures the
expansion slot cover to the system unit. Save the screw to secure
the interface card retaining bracket.
5. Carefully grasp the upper edge of the PCI-1751. Align the hole in
the retaining bracket with the hole on the expansion slot and align
the gold striped edge connector with the expansion slot socket.
Press the card into the socket gently but firmly. Make sure the card
fits the slot tightly.
6. Secure the PCI-1751 by screwing the mounting bracket to the back
panel of computer.
7. Attach any accessories (68-pin cable, wiring terminal, etc.) to the
card.
8. Replace the cover of your computer. Connect the cables you
removed in step 2.
9. Turn the computer power on.
CHAPTER
Operation
Introduction
The PCI-1751 emulates two 8255 programmable peripheral interface
(PPI) chips in mode 0, but with higher driving capability than a
standard 8255 chip. Each of the 8255 chips has 24 programmable I/O
pins that are divided into three 8-bit ports. The total 48 DI/O pins from
both chips are divided into 6 ports, designated PA0, PB0, PC0, PA1,
PB1 and PC1. Each port can be programmed as an input or an output
port. The I/O pins in port A0 are designated PA00, PA01,..., PA07; the
pins in port B0 are designated PB00, PB01,..., PB07, etc. These port
names are used both in this manual and in the software library. Refer
to Section 2.5, Pin Assignments.
8255 Mode 0
The basic functions of 8255 mode 0 include:
• Two 8-bit I/O ports - port A (PA) and port B (PB)
• Port C is divided into two nibble-wide (4-bit) I/O ports:- PC upper
and PC lower
• Any port can be used for either input or output.
• Output status can be read back.
Input/Output Control
A control word can be written to a port's configuration register
(Base+3 for port 0 and Base+7 for port 1) to set the port as an input or
an output port, unless the ports are set as output ports via jumpers
(refer to Section 2.3, Jumper Settings). Table 3-1 shows the format of a
control word.
D7 D6 D5 D4 D3 D2 D1 D0
External Internal
PC 5V
10 K Ω
1.5 K Ω Buffer
0.5 W
Dry Contact: Open High
Close Low
Resistor
in Wet Contact: 2.0~5.25 V D C High
Parallel 0~0.8 V D C Low
Timer/Counter Operation
Introduction
The PCI-1751 includes one 8254 compatible programmable timer/
counter chip which provides three 16-bit counters, designated as
Timer 0, Timer1 and Counter 2. Each has 6 operation modes. Timer 0
and Timer 1 can be used separately or can be cascaded to create one
32-bit timer. Both Timer 1 and Counter 2 can generate interrupts to the
computer. Please refer to Appendix A for more information on the
operation modes of the counter chip. The block diagram of the timer/
counter system is shown in Figure 3-2.
Counter 2
Counter 2 can be a 16-bit timer or an event counter, selectable by
setting JP3. When the clock source is set for an internal source,
Counter 2 is a 16-bit timer; when set as an external source, then
Counter 2 is an event counter. Counter 2 is set as mode 0 (interrupt on
terminal count) in the driver provided by Advantech.
Introduction
Two lines in each I/O port (C0 and C4) and two of the three counter
outputs (Timer 1 and Counter 2) are connected to the interrupt
circuitry. The "Interrupt Control Register" of the PCI-1751 controls
how the combination of the 6 signals generates an interrupt. Two
interrupt request signals can be generated at the same time, and then
the software can service these two request signals by ISR. The dual
interrupt sources provide the card with more capability and flexibility.
IRQ Level
The IRQ level is set automatically by the PCI plug and play BIOS and
is saved in the PCI controller. There is no need for users to set the IRQ
level. Only one IRQ level is used by this card, although it has two
interrupt sources.
APPENDIX
Function of 8254
Counter Chip
Register Function
BASE+24 Counter 0 read/write
BASE+25 Counter 1 read/write
BASE+26 Counter 2 read/write
BASE+27 Counter control word
Since the 8254 counter uses a 16-bit structure, each section of read/
write data is split into a least significant byte (LSB) and most signifi-
cant byte (MSB). To avoid errors it is important that you make read/
write operations in pairs and keep track of the byte order.
Description:
SC1 & SC0 Select counter
M2 M1 M0 Mode
0 0 0 0 programmable one shot
0 0 1 1 programmable one shot
X 1 0 2 Rate generator
X 1 1 3 Square wave rate generator
1 0 0 4 Software triggered strobe
1 0 1 5 Hardware triggered strobe
BCD Type
0 Binary counting 16-bits
1 Binary coded decimal (BCD) counting
If you set the module for binary counting, the count can be any
number from 0 up to 65535. If you set it for BCD (Binary Coded
Decimal) counting, the count can be any number from 0 to 9999.
If you set both SC1 and SC0 bits to 1, the counter control register is in
read-back command mode. The control register data format then
becomes:
Read/Write Operation
Before you write the initial count to each counter, you must first
specify the read/write operation type, operating mode and counter
type in the control byte and write the control byte to the control
register (BASE+27).
Since the control byte register and all three counter read/write
registers have separate addresses and each control byte specifies the
counter it applies to (by SC1 and SC0), no instructions on the operat-
ing sequence are required. Any programming sequence following the
8254 convention is acceptable.
There are three types of counter operation: read/load LSB, read /load
MSB and read /load LSB followed by MSB. It is important that you
make your read/write operations in pairs and keep track of the byte
order.
Counter Applications
The 8254 compatible programmable interval timer/counter on your
PCI-1751 interface card is a a very useful device. You can program
timers 1 and 2 to serve as timers, event counters, square wave genera-
tors, or as a watchdog to generate regular interrupts at a fixed interval.
APPENDIX
Register Format of
PCI-1751