Erma Electronic PCI 1389-S02 User manual

ERMA
Electronic GmbH
ERMA
Electronic GmbHElectronic GmbH
PCI 1389-S02
Incremental Counter Card
Special Application
Instruction Manual

Trademarks
Turbo Pascal, Delphi are registered trademarks of Borland International, INC.
MS-DOS, indows, Visual Basic are registered trademarks of Microsoft Corporation.
IBM, PC XT/AT, OS/2 are registered trademarksin of the International Business Machines
Corporation.
All other trademarks named or portrayed in the text are registered trademarks of its ownwer and are
recognized by ERMA-Electronic.
Warranty
For delivered products our "Allgemeine Lieferungs- und Zahlungsbedingungen" are effective.
In no event ERMA-Electronic or its suppliers shall be liable for any other damages whatsoever
(including, without limitation, damages for loss of business profits, business interruption or
other pecuniary loss) arising out of or inability to use this product.
All products from ERMA-Electronic are warranted against defective material and workmanship
for a period of two (2) years from date of delivery. If it is necessary to return the product to ERMA,
the sender is responsible for shipping charges, freight, insurance and proper packaging to pre-
vent breakage in transit. ERMA's warranty does not apply to defects resulting from action of the
buyer, such mishandling, improper interfacing, operation outside of design limits, improper repair
or unauthorized modification.

CONTENTS
1. Safety Instructions .......................4
2. Repair ..............................4
3. Symbol explanation ......................5
4. General .............................5
5. Function .............................6
5.1. Block diagram .......................7
6. Hints against noisy environment ...............8
7. Installation ...........................8
7.1. Hardware configuration ..................8
7.1.1.Component layout ...................9
7.1.2.Connection of encoders ................10
7.1.3.Connection of digital inputs ...............10
7.1.4.Connection of digital outputs ..............10
7.2. Open PC ..........................10
7.3. Card insertion .......................10
7.4. Close PC ..........................11
7.5. Driver installation .....................11
7.5.1.Windows 95 / 98 / ME .................11
7.5.2.Windows NT4.0 .....................11
7.5.3.Windows 2000 .....................11
ERMA-Electronic GmbH 2

7.6. Configure software .....................11
7.7. Test of the card ......................12
8. The registers of the PCI 1389-S02 ...............12
8.1. Counterregisters for Counter 1 and 2 ...........12
8.2. Mode register .......................12
8.3. Status-/Latchregister ....................15
8.4. Interrupt-Enable-Register .................16
8.5. Interrupt-Status-Register ..................17
8.6. Reference register .....................17
8.7. IO-register .........................18
9. Programming ..........................19
9.1. Programming under Windows 95/98/ME .........19
9.2. Programming under Windows NT4.0/2000 ........19
9.3. Programming via the PCI1389S02-DLL ..........19
10. Pin assignment .........................23
11. Troubleshooting ........................24
12. Technical datas .........................25
13. Ordering information ......................25
Stand : Mai, 2003
PCI1389A.PUB (PCI1389AS02)
Technical subjects to change
3 ERMA-Electronic GmbH

1. Safety Instructions
This pc-card is produced in accordance with Class II of IEC 348 and VDE 0411.
When delivered the card has been tested to meet all functions described. Before
installing the card please read the mounting and servicing instructions. We have
no liability or responsibility to customer or any other person or entity with respect
toanyliability,lossordamagecaused orallegedtobecaused directlyorindirectly
by equipment or software sold or furnished by us. Read the installation instruction
carefully. No liability will be assumed for any damage caused by improper
installation.
Inspect the pc-cards carton for obvious damages. Be sure there are no shipping
and handling damages on the card before processing. Do not apply power to the
card if it has damages.
The warranty does not apply to defects resulting from action of buyer, such as
mishandling, improper interfacing, operation outside of design limits, improper
repair or unauthorized modifications.
2. Repair
Maintenance and repair have to be done by qualified persons only. This persons
havetobefamiliarwiththerisksofthiskindofworkandhavetoknow thewarranty
regulations.
It is recommended to keep the original package of the card. The anti static plastic
foam within the package gives the card an perfect protection. The package can
be used for storage or shipment of the card.
1. Safety Instructions
ERMA-Electronic GmbH 4

3. Symbol explanation
Caution Attention Instruction Tip
Caution: Will be used at dangerous for life and health !
Attention: Will cause damage.
Instruction: If not noticed, Trouble may occur.
Tip: Useful hints for better operation.
4. General
The counter card PCI 1389-S02 has two 32-Bit incremental up/down counter.
TheinputchannelsofthesecountersareprovidedwithisolatedRS422interfaces.
In addition there is one 16-Bit reference counter with a RS422 interface which is
also isolated.
For controlling tasks there are 4 isolated digital input channels and 4 isolated
digital output channels.
The two up/down counter can be programmed for 1-, 2-, or 4-fold mode counting.
It is also possible to use the counters as event counters. Alternatively there is the
possibilitytomeasure thetimeeventof each incrementwitha resolutionof 5 MHz
or 10 MHz. Additional it is possible to trigger on the change of the counting
direction.
The reference counter is able to trigger the two up/down counters. With the aid
of the reference counter it is also possible to generate constant time intervals for
measurements.
Thedigitalinputand outputchannelscanbe usedforcontrollingtasks.Inaddition
the digital input channel 0 can be used to trigger the two up/down counters either
with the raising edge or the falling edge of the input signal.
3. Symbol explanation
5 ERMA-Electronic GmbH

5. Function
ThePCI1389-S02hasaPCI-Target-ControllertoconnecttothePCI-bus,aFPGA
which contains the whole functionality of the card, and also 4 bidirectional
RS422-Ports, 8 unidirectional RS422-Ports, 4 digital inputs and 4 digital outputs.
To prevent damage, the card contains a galvanic (optical) isolation to the pc.
After a reset the FPGA will boot his configuration out of an serial PROM. The
FPGA-functions are not implemented as software, they are implemented as
hardware! So extremely high working speeds are possible. The functions of the
card can be totally changed only by exchanging the PROM.
Special-function -S01
The PCI 1389-S02 has 2 x 32-Bit-Incremental-counter/timer with RS422-Inputs,
1 x 16-Bit-Reference-counter/timer with RS422-Input, 4 digital, short circuit
protected outputs and 4 digital inputs.
The 32-Bit-counters could be used as incremental counter with 1-, 2-, 4-fold
evaluation or as event-counter with max. 10 MHz input frequency. It is also
possible to use these counters as timers with a timebase of 5/10 MHz. In this
mode the counter-value will be stored with each input-pulse. Because of the 1-,
2- and 4-fold mode it is possible to measure the time between all possible signal
edges. Each 32-Bit-counter has a 32 value deep FIFO to store the triggered
values. The triggering can be programmed separatly for each counter to softwa-
retriggering, reference-counter-triggering, digital-input-triggering or time-trigge-
red mode. It is possible to measure up to 10.000 values per second, depending
on the long latency of Microsoft Windows. On faster PC’s the number of meas-
urements per second increases.
The triggering on the change of the counting direction allows the measuring of
the minimum and maximum angle and the repeatability of this angles.
The reference-counter serves for synchronous data aquisition. It can be used as
incremental counter to trigger the main-counters at always the same machine-
position. Therefore a trigger is generated each incremental step (1-, 2-, 4-fold
evaluation) beginning after the first index-pulse (zero-pulse) of the reference-
counter. In another mode the reference-counter is used as a programmable timer
with up to 20 kHz to aquire the counter-values in equidistant time steps.
The digital in- and outputs can be used for controlling tasks. Digital input 0 could
also be used as external trigger input for one or both main-counter.
The PCI 1389-S02 has several additional parameters. With these parameters it
is possible to change polarity of reset-inputs, change rotation direction, data
aquisition on rising or falling edge and so on. So the card can be configured in
most environments and applications without changes on wiring. Because of the
RS422-inputs the card can be used in rough industrial environment.
5. Function
ERMA-Electronic GmbH 6

5.1. Block diagram
Counter 1
Counter 2
Reference-
counter
IO
IRQ
PCI-Decoder
5. Function
7 ERMA-Electronic GmbH

6. Hints against noisy environment
All inputs and outputs are protected against noisy environment and high voltage
spikes. Nevertheless the location should be selected toensure that no capacitive
or inductive interferences can have an effect on the instrument or connection
lines.
It is advisable:
• To use shielded, twisted pair cables.
• The wiring of shields and ground (0V) should be star-shaped.
• Thedistancetointerferencesourcesshouldbeasfaraspossible.Ifnecessary,
protective screen or metal enclosures must be provided.
• Coils of relays must be supplied with filters.
Parallel wiring of input signals and AC power lines should be avoided.
7. Installation
The installation of the card should only be done by qualified personal only. Before
installation all components have to be disconnected from power supply. Because
within PC’s and the peripherals are high voltages it is dangerous to life!
7.1. Hardware configuration
The PCI 1389-S02 uses plug and play and so there is no need for any settings.
6. Hints against noisy environment
ERMA-Electronic GmbH 8

7.1.1. Component layout
7. Installation
9 ERMA-Electronic GmbH

7.1.2. Connection of encoders
The signals A, A#, B, B#, Z, Z# of the encoder must be connected to the card.
The signals A#, B# und Z# are the inverted signals of A, B and Z. Because the
PCI 1389-S02 uses RS422-receiver, the non inverting and the inverting signals
have to be connected.
The input A (non inverting and inverting!) should be connected to encoder-output
A (0°), the input B (non inverting and inverting!) to encoder-output B (90°). The
input Z (non inverting and inverting!) could be connected to the zero-output of the
encoder. The counter will then be reset at the index position of the encoder each
turn. Alternativly the Z input could be connected to an external zero position of a
machine or left open.
7.1.3. Connection of digital inputs
The PCI 1389-S02 contains 4 digital inputs. These inputs are highsidedriven and
high-activ. The input circuit is build as voltage divider (100kΩfixed resistor and
R33).
7.1.4. Connection of digital outputs
The PCI 1389-S02 contains 4 digital outputs. These outputs are short circuit
protected highside switches with a voltage range of 7 - 30 VDC.
7.2. Open PC
Beforeopeningthepc-casedisconnectpowersupply!Thecaseshouldbeopened
as described by the manufacturer of the PC.
7.3. Card insertion
While inserting the card you could be hurt. This is because all components on the
cards and in the PC have sharp pins. So this work have to be done carefully. The
PCI 1389-S02 should be placed in a free PCI-Slot. The card should be installed
vertically from above. Afterwards the slot plate of the card have to be screwed to
the backside of the PC-case.
7. Installation
ERMA-Electronic GmbH 10

The slot plate is used for mounting and also for shielding. Keep in
mind that removal of the plate will result in loss of shielding and card
and PC will be more sensitive to EMC. Additionaly the card won’t be
heldinslot-positionwhenexternalforcewillhappentotheconnected
cables. Then the card could move within the slot and that can result
in damage to the PCI1389-S02 and the PC! So, don’t remove the
slot plate!
7.4. Close PC
The case should be closed as described by the manufacturer of the PC.
7.5. Driver installation
On most Windows-versions you must have administrator rights to install
drivers.
7.5.1. Windows 95 / 98 / ME
Windows will recognize the new card and ask for the driver. The driver is on the
disc within the directory Win9x.
ATTENTION: Windows 95 does notsupport PCI-SubvendorID. So youcan’tuse
different cards with AMCC S5920Q. If that happens, please use Windows 98
instead.
7.5.2. Windows NT4.0
You have to start the program SETUP.EXE. The program is on the disc within
the directory WINNT40. The program will install the driver and the DLL.
7.5.3. Windows 2000
Windows will recognize the new card and ask for the driver. The driver is on the
disc within the directory Win2000.
7.6. Configure software
All example-programs are shipped as executable and source-code.
7. Installation
11 ERMA-Electronic GmbH

7.7. Test of the card
After installation the card could be tested. Therefor you can use the example-pro-
grams on the disc or the frontpanel-software.
8. The registers of the PCI 1389-S02
The PCI 1389-S02 uses 2 IO-address-ranges and 1 interrupt. Because of the
plug-and-play of the PCI-bus these data should be found out for direct program-
ming.Thereforefunctions oftheBIOS hastobe usedlikedescribedin “PCI BIOS
SPECIFICATION Revision 2.1" or later.
The PCI 1389-S02 uses a configuration space header type 00h. The datas could
be found in the PCI-configuration space on BaseAddress0, BaseAddress1 and
InterruptLine. With BIOS-functions the data couldbe read out of the configuration
space. BaseAddress0 is used for the PCI-target controller, BaseAddress1 for the
functions of the card.
If the PCI1389S02.DLL is used (described later), these informations are handled
within the dll.
8.1. Counterregisters for Counter 1 and 2
Read
BaseAddress1 + 0 Read fifo of counter 1
BaseAddress1 + 4 Read fifo of counter 2
Write
BaseAddress1 + 0 Set counter 1 value
BaseAddress1 + 4 Set counter 2 value
The 32-Bit counter registers of counter 1 and 2 are used to read and write the
counters.Tosetacountervalue,thecountermustbestopped!Thecountervalues
can only be read out of the fifo. Therefore the counter has to be triggered or
latched.
8.2. Mode register
The mode register controls the modes of the PCI 1389-S02 and is used to start
and stop the counters. Unused bits should be masked or set to 0. The bits are
used as follows:
8. The registers of the PCI 1389-S02
ERMA-Electronic GmbH 12

Read and write BaseAddress1 + 8
Bit 1 .. 0
Mode of counter 1
00 Incremental evaluation 1-fold
01 Incremental evaluation 2-fold
10 Incremental evaluation 4-fold
11 Event counting
Bit 3 .. 2
Trigger mode of counter 1
00 Softwaretrigger
01 Trigger on change of counting direction
10 Trigger on reference counter
11 Trigger on digital input 0
Bit 5 .. 4
Mode of counter 1
00 Inkremental evaluation
01 Inkremental evaluation
10 Time measuring (5 MHz)
11 Time measuring (10 MHz)
Bit 6 Direction of incremental counter 1
0 “normal" count direction
1 reverse count direction
Bit 7 Polariy of reset input of counter 1
0 High resets counter
1 Low resets counter
Bit 8 Counter 1 enable
0 Counter stopped
1 Counter started
Bit 9 Resetof counter 1 through reference counter enable
0 Disabled
1 Enabled
Bit 13 .. 12
Mode of counter 2
00 Inkremental evaluation 1-fold
01 Inkremental evaluation 2-fold
10 Inkremental evaluation 4-fold
11 Event counting
Bit 15 .. 14
Trigger mode of counter 2
00 Softwaretrigger
01 Trigger on changing the counting direction
10 Trigger on reference counter
11 Trigger on digital input 0
Bit 17 .. 16
Mode of counter 2
00 Inkremental evaluation
01 Inkremental evaluation
10 Time measuring (5 MHz)
11 Time measuring (10 MHz)
8. The registers of the PCI 1389-S02
13 ERMA-Electronic GmbH

Bit 18 Direction of incremental counter 2
0 “normal" Direction
1 reverse direction
Bit 19 Polarity of reset input of counter 2
0 High resets counter
1 Low resets counter
Bit 20 Counter 2 enable
0 Counter stopped
1 Counter started
Bit 21 Reset counter 2 through reference counter enable
0 Disabled
1 Enabled
Bit 22 Trigger mode of digital input 0
0 Trigger on rising edge
1 Trigger on falling edge
Bit 27 .. 26
Mode of reference counter (Counter 4)
00 Inkremental evaluation 1-fold
01 Inkremental evaluation 2-fold
10 Inkremental evaluation 4-fold
11 Event counting
Bit 28 Direction of reference counter (Counter 4)
0 “normal" direction
1 reverse direction
Bit 29 Polarity of reset input of reference counter (Counter 4)
0 High resets counter
1 Low resets counter
Bit 30 Mode of reference counter (Counter 4)
0 Inkremental evaluation
1 Timer
Bit 31 Reference counter enable (Counter 4)
0 Counter stopped
1 Counter started
8. The registers of the PCI 1389-S02
ERMA-Electronic GmbH 14

8.3. Status-/Latchregister
The status-/latchregister is used to latch the counters (softwaretrigger) and to
inspect the status of the card.
Read BaseAddress1 + 12
Bit 0 Status “Counter 1 waiting”
Bit 1 Status “Counter 1 running”
Bit 2 Status “Counter 1 stopped”
Bit 3 Status “Counter 1 fifo not empty (data present)"
Bit 4 Status “Counter 1 fifo overflow (data lost)”
Bit 5 Status “Incremental step error on Counter 1 (missing increment)"
Bit 12 Status “Counter 2 waiting”
Bit 13 Status “Counter 2 running”
Bit 14 Status “Counter 2 stopped”
Bit 15 Status “Counter 2 fifo not empty (data present)"
Bit 16 Status “Counter 2 fifo overflow (data lost)”
Bit 17 Status “Incremental step error on counter 2 (missing increment)"
Bit 26 Status “Reference counter waiting”
Bit 27 Status “Reference counter running”
Bit 28 Status “Reference counter stopped”
Bit 29 Status “Incremental step error on Reference counter (missing
increment)”
Write BaseAddress1 + 12
Bit 0 Latch counter 1 (store counter value in fifo)
Bit 1 Latch counter 2 (store counter value in fifo)
8. The registers of the PCI 1389-S02
15 ERMA-Electronic GmbH

8.4. Interrupt-Enable-Register
The interrupt-enable-register is used to enable or disable some or all interrupt
sources. Interrupts are enabled if the corresponding bit is set.
Read and write BaseAddress1 + 16
Bit 0 Interrupt if status changes to “Counter 1 running”
Bit 1 Interrupt if status changes to “Counter 1 stopped”
Bit 2 Interrupt if status changes to “Counter 1 fifo not empty"
Bit 3 Interrupt if fifo overflow on counter 1
Bit 4 Interrupt if incremental step error on counter 1
Bit 12 Interrupt if status changes to “Counter 2 running”
Bit 13 Interrupt if status changes to “Counter 2 stopped”
Bit 14 Interrupt if status changes to “Counter 2 fifo not empty"
Bit 15 Interruptif fifo overflow on counter 2
Bit 16 Interrupt if incremental step error on counter 2
Bit 22 Interrupt on changes at digital input 0
Bit 23 Interrupt on changes at digital input 1
Bit 24 Interrupt on changes at digital input 2
Bit 25 Interrupt on changes at digital input 3
Bit 26 Interrupt if status changes to “Reference counter running”
Bit 27 Interrupt if status changes to “Reference counter stopped”
Bit 28 Interrupt if incremental step error on reference counter
Bit 31 Global interrupt enable
0 All interrupts disabled
1 Interrupts enabled
8. The registers of the PCI 1389-S02
ERMA-Electronic GmbH 16

8.5. Interrupt-Status-Register
Theinterrupt-status-registerisused togetthesourceof aninterrupt.Allinterrupts
enabled or disabled are shown!
Read BaseAddress1 + 20
Bit 0 Status has changed to “Counter 1 running”
Bit 1 Status has changed to “Counter 1 stopped”
Bit 2 Status has changed to “Counter 1 fifo not empty"
Bit 3 Counter 1 fifo overflow
Bit 4 Counter 1 incremental step error
Bit 12 Status has changed to “Counter 2 running”
Bit 13 Status has changed to “Counter 2 stopped”
Bit 14 Status has changed to “Counter 2 fifo not empty"
Bit 15 Counter 2 fifo overflow
Bit 16 Counter 2 incremental step error
Bit 22 Digital input 0 changed
Bit 23 Digital input 1 changed
Bit 24 Digital input 2 changed
Bit 25 Digital input 3 changed
Bit 26 Status has changed to “Reference counter running”
Bit 27 Status has changed to “Reference counter stopped”
Bit 28 Reference counter incremental step error
8.6. Reference register
The reference register contains the time divider for timer mode of the reference
counter. The maximum possible rate 20 kHz (divider = 1) will be divided by the
programmed divider. Divider = 0 is not possible!
Read and write BaseAddress1 + 24
Bit 15 .. 0 Time divider for reference counter in timer mode
8. The registers of the PCI 1389-S02
17 ERMA-Electronic GmbH

8.7. IO-register
The IO-register is used to set or read the status of the digital IO’s.
Read BaseAddress1 + 28
Bit 0 State of digital output 0 (read back)
Bit 1 State of digital output 1 (read back)
Bit 2 State of digital output 2 (read back)
Bit 3 State of digital output 3 (read back)
Bit 4 State of digital input 0
Bit 5 State of digital input 1
Bit 6 State of digital input 2
Bit 7 State of digital input 3
Write BaseAddress1 + 28
Bit 0 Set digital output 0
Bit 1 Set digital output 1
Bit 2 Set digital output 2
Bit 3 Set digital output 3
8. The registers of the PCI 1389-S02
ERMA-Electronic GmbH 18

9. Programming
9.1. Programming under Windows 95/98/ME
Fortheprogrammingunderwindows95/98/MEthecardcomeswithaappropriate
driver. To keep the programming as easy as possible, all functions for the PCI
1389-S02 are placed in a dll. So there is no need to program the PCI 1389-S02
directly.
This dll contains 2 types of functions. At first there are low-level function which
can be used to handle the cards register. The second set of functions are
high-level functions. These high-level functions are using a bigger software-fifo
to handle higher trigger rates.
The PCI1389S02.DLL should be copied out of the corresponding driver directory
into the system folder or the project folder of the application.
9.2. Programming under Windows NT4.0/2000
For the programming under windows NT4.0/2000 the card comes with a appro-
priate driver. To keep the programming as easy as possible, all functions for the
PCI1389-S02areplacedinadll.SothereisnoneedtoprogramthePCI1389-S02
directly.
This dll contains 2 types of functions. At first there are low-level function which
can be used to handle the cards register. The second set of functions are
high-level functions. These high-level functions are using a bigger software-fifo
to handle higher trigger rates.
The PCI1389S02.DLL should be copied out of the corresponding driver directory
into the system folder or the project folder of the application.
9.3. Programming via the PCI1389S02-DLL
The DLL PCI1389S02.DLL provides the basic and the extended functions for the
work with the PCI 1389-S02. The low-level and high-level functions should not
be mixed, because this can result in mistakes. The return value of all functions
will show an incorrect execution if a 0 is returned. The function GetLastError can
be used to get a more detailed error message. Programs designed for
PCI1389S02-DLL can be used on Windows 9x/ME and also on NT 4.0/2000, if
the corresponding DLL is used.
9. Programming
19 ERMA-Electronic GmbH
Table of contents
Popular PCI Card manuals by other brands

StarTech.com
StarTech.com PEX1394B3 instruction manual

Inventa
Inventa VOVERLAY user manual

Digitus
Digitus DS-33102-1 user manual

Acces I/O products
Acces I/O products PCIe-COM-4SMDB user manual

United Electronic Industries
United Electronic Industries DNA-CAR-550 user manual

Linksys
Linksys WMP11 ver. 2.7 user guide