B&B Electronics 2IQEC2 User Manual

Size:
250.34 Kb
Download

Quadrature Encoder Counter Board

Models: 2IQEC2 2IQEC4

Documentation Number 2IQEC2/43798

This product

Designed and Manufactured

In Ottawa, Illinois

USA

of domestic and imported parts by

B&B Electronics Mfg. Co. Inc.

707 Dayton Rd. P.O. Box 1040 --Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Internet: http://www.bb-elec.com orders@bb-elec.com support@bb.elec.com

1998 B&B Electronics --September 1998

2IQEC2/43798 Manual Cover Page

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Table of Contents

 

CHAPTER 1: INTRODUCTION............................................................

1

PACKING LIST ...........................................................................................

1

ADDRESS SWITCH SETUP ..........................................................................

1

SPECIFICATIONS ........................................................................................

2

CHAPTER 2: INSTALLATION .............................................................

3

SOFTWARE INSTALLATION........................................................................

3

INSTALLING THE CARD .............................................................................

3

CARD SETTINGS ........................................................................................

3

Address.................................................................................................

3

IRQ .......................................................................................................

5

Configuring the jumpers ......................................................................

6

SOFTWARE REGISTERS..............................................................................

8

Flag Register........................................................................................

8

Reset and Load Signal Decoders (RLD) ..............................................

8

Counter Mode Registers (CMR) ..........................................................

9

Input/Output Control Register (IOR).................................................

10

Index Control Registers (IDR) ...........................................................

11

CHAPTER 3: TROUBLESHOOTING ..................................................

12

APPENDIX A: HARDWARE I/O MAP.............................................

A-1

I/O MAP OF XT CLASS MACHINES .......................................................

A-1

HARDWARE I/O MAP OF AT CLASS MACHINES ...................................

A-2

APPENDIX B: SPECIFICATIONS/TIMING DIAGRAMS .............

B-1

PIN DESCRIPTION .................................................................................

B-1

ADDRESSES ...........................................................................................

B-1

TRANSIENT CHARACTERISTICS .............................................................

B-2

Quadrature Mode.............................................................................

B-2

Non-QuadratureMode.....................................................................

B-2

APPENDIX C: TYPICAL SET-UPEXAMPLES ..............................

C-1

2IQEC2/43798 Manual

Table of Contents

i

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Chapter 1: Introduction

The 2IQEC2/4 is a 2/4 channel quadrature encoder 24 bit counter card used to track the position of up to 4 separate encoders. This card is an ISA card that can be used in either an 8 or 16 bit slot. This card allows the computer to keep track of position without a lot of CPU overhead, freeing it up for more important tasks.

The 2IQEC2/4 offers a huge amount of flexibility. Upon a borrow or carry the card can be configured to reset, load a preset, cause an interrupt request or simply send out a TTL signal to indicate the carry or borrow. The card contains two inputs that can be configured to clear the counter or load the preset into the counter. The index lines may also be used to clear the counter, load the preset or cause an interrupt. The four channels use IRQ sharing to prevent all the computer's resources from being taken up by this card. The interrupt service routine can poll the card to find out which channel caused the interrupt request.

Packing List

Examine the shipping carton and contents for physical damage. The following items should be in the shipping carton:

1.2IQEC2 or 2IQEC4

2.2IQEC2/4 3.5" disk

3.This instruction manual

If any of these items are damaged or missing contact B&B Electronics immediately.

Address Switch Setup

The 2IQEC2/4 cards use a 7-positionDIP switch to program the binary I/O address of each port on the card. The 2IQEC2/4 cards are factory configured for address 0x300 with no IRQ. If you plan on installing the 2IQEC2/4 with these settings, check the switch settings to ensure that they did not get inadvertently changed during shipping.

2IQEC2/43798 Manual

1

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Specifications

Bus: IBM PC ISA Bus

Slot: Requires 1 full length slot for complete IRQ selectability. When installed in a short slot, IRQs 10-15will not be available. The four channel card requires an additional space to mount the connectors in the back panel. This space does not need a slot on the motherboard.

Dimensions: 8.75" x 4.4"

I/O connection: 15-pinfemaleD-subconnectors Interrupt: IRQ2-7,10-12,14, or 15.

Address: Switch programmable, 0 to hex 7F0 RS-422Differential inputs

Differential input high-thresholdvoltage 0.2V maximum Differential input low threshold voltage-0.2Vmaximum Input differential voltage range 1.5 to 6 volts

TTL inputs

Input high threshold 2 V Maximum Input low threshold 0.7 V Maximum Input voltage range -0.2to 5.5 volts TTL outputs

1 mA source @ 4.375 V

5 mA sink @ 0.5 V

12 MHz count rate in quadrature 4X mode. 24-bitcounters for up to four axes on 2IQEC4 (two axes on 2IQEC2)

Digital filtering of the quadrature clocks Power Consumption

+5 VDC @ 250 mA

(See additional specifications in Appendix B.)

2

2IQEC2/43798 Manual

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Chapter 2: Installation

Software Installation

The 2IQEC2/4 comes with a useful example program. This example program may be used royalty free when used with the B&B Electronics 2IQEC2/4. Any other use is strictly prohibited. To install this example file on your hard drive:

1.Place the disk in drive A:

2.Type A: and press the<ENTER> key.

3.Type Install and press the<ENTER> key.

4.Follow the instructions given by the program.

Installing the Card

1.Turn the power to your computer off.

2.Remove the cover of the computer. Be sure to use proper grounding techniques.

3.Pick any full length (16-bit)unused slot. Although the 2IQEC2/4 cards will work in a short(8-bit)slot, IRQ's10-15will not be available.

4.Remove the expansion slot cover. Save the screw for installation of the 2IQEC2/4 card.

5.Set the address, IRQ, and other jumper settings. See Card Settings in the next section for instructions on setting the address and IRQ.

6.Install the 2IQEC2/4 card into the unused slot. Be certain that the card is inserted completely into the slot.

7.Secure the card with the mounting screw.

Card Settings

Address

Switch S1 configures the address of the card. Switches represent a 0 in the ON position, 1 when OFF. The address lines are labeled on the card. SA10 is the MSB and SA4 is the LSB. Table 1 shows the numerical weight and electrical connection of each switch position.

2IQEC2/43798 Manual

3

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Table 1. Address Switches

 

 

1st Digit

 

 

2nd Digit

 

Switch

7

 

6

 

5

4

3

2

1

Position

 

 

 

 

 

 

 

 

 

Bus

SA10

 

SA9

 

SA8

SA7

SA6

SA5

SA4

Connection

 

 

 

 

 

 

 

 

 

Decimal

1024

 

512

 

256

128

64

32

16

Weight

 

 

 

 

 

 

 

 

 

Hex Weight

400

 

200

 

100

80

40

20

10

To set the address of the 2IQEC2/4 card at some common locations, follow the switch settings shown in Table 2.

Table 2. Frequently Unused Port Addresses

Base

Binary

Switch

I/O Space

Hex

Equivalent

Settings

Description

Address

 

MSB LSB

 

 

 

7654321

 

200

1000000000

0100000

game port

300

1100000000

0110000

prototype

310

1100010000

0110001

prototype

380

1110000000

0111000

SDLC

3A0

1110100000

0111010

bisync com

To install at another address, follow the procedure below.

1.Select the address. Using an I/O port usage table (one is included in Appendix A) select an unused hex address space. Note that the card occupies 16 bytes of I/O space. Use caution when selecting a port address. It is very important that nothing else is installed at the selected address.

2.Convert the hex address to its binary equivalent.

3.Throw away the 4 least significant bits.

4.The remaining 7 digits represent the switch address. 1's represent an OFF switch. 0's represent an ON switch.

4

2IQEC2/43798 Manual

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

IRQ

The 2IQEC2/4 card allows the use of interrupts (IRQ) 2-7,10-12,14, and 15. This interrupt is shared with all the channels. To determine the channel that caused the interrupt, the interrupt service routine must read the address located at the base address plus 8. The lower nibble will indicate which channel caused the interrupt. Where bit 0 is theX-Axis,bit 1 is theY-Axis,bit 2 is the Z- Axis, and bit 3 is theW-Axis.The upper nibble is not used. To clear the interrupt, the interrupt service routine must read or write to the address located at base address plus 12 (0xC). The IRQ is set by placing a jumper on JP1. Only one jumper should be placed on JP1 at any one time. Check Table 3 for common interrupt uses.

Table 3. Hardware Interrupts

IRQ

AT machines

XT machines

2

routed to IRQ controller 2

Reserved

3

serial port COM2,4

Serial port COM2,4

4

serial port COM1,3

Serial port COM1,3

5

LPT2

hard disk

6

floppy disk

Floppy disk

7

LPT1

parallel printer port 1 (LPT1)

8

real-timeclock

not available

9

re-directedto IRQ2

not available

10

Unassigned

not available

11

Unassigned

not available

12

Unassigned

not available

13

Coprocessor

not available

14

hard disk

not available

15

Unassigned

not available

The conditions required to generate an interrupt can be selected by the use of jumpers. Each axis is independently configured. Note that more than one condition can be configured to generate the interrupt. Note that the use of an interrupt is not required.

2IQEC2/43798 Manual

5

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Configuring the jumpers

The jumpers located on the left side of the card make it easy to configure the card to your individual needs. The jumpers are grouped by axis and function. The top group of jumpers is for the X axis. Then next groups going down are for the Y-axis,Z-axis,andW-axisrespectfully. There are three signals that can be routed via these jumpers. They are the FLG1 and FLG2 outputs from the counter chips, and the index from the encoder. The FLG1 and FLG2 outputs are software configurable. The FLG1 can be configured to act as a carry (pulse on counter overflow), compare (pulse when counter equals the preset register), index, or carry and borrow (pulse on either an overflow or an underflow of the counter). The FLG2 can be configured to act as a borrow,up-downindicator, or an error flag. These outputs are brought to the user connectors.

The first jumpers labeled JP4, JP8, JP12 and JP16 allow you to select what conditions cause the counter to be loaded with the preset value in the preset register. The middle jumpers labeled JP3, JP7, JP11, and JP15 allow you to select what conditions cause the counter to be reset or the counter to be enabled depending on the software configuration of the input. The last jumpers labeled JP2, JP6, JP10, and JP14 are used to define what conditions cause an interrupt (IRQ).

JP5 selects the type of input encoder signals for the X and Y axes not including the index. Set jumper JP5 for RS-422differential mode and remove the jumper for TTL level encoder input. When in differential mode the TTL output of the differential receivers is present at the TTL pins. Leave these pins unconnected in differential mode.

JP13 selects the type of input encoder signals for the Z and W axis not including the index. Set jumper JP13 for RS-422differential mode and remove the jumper for TTL level encoder input. When in differential mode the TTL output of the differential receivers is present at the TTL pins. Leave these pins unconnected in differential mode.

JP9 selects the type of input from the index pins. This jumper affects all the axes' index inputs. Set jumper JP9 for RS-422differential mode and remove the jumper for TTL level encoder input. When in differential mode the TTL output of the index receivers is present at the TTL pins. Leave these pins unconnected in differential mode.

6

2IQEC2/43798 Manual

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Location of Jumpers

2IQEC2/43798 Manual

7

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105

Software Registers

Flag Register (Read Data Address)

The FLAG register is a read-onlyregister that holds the status information of the counters and can be read out on the data bus. To read the FLAG byte for any axis, read the control address of that axis.

FLAG Byte Defined

7 6 5 4 3 2 1 0

BT: Borrow toggle flip-flop.

Toggles every time CNTR underflows

CT: Carry toggle flip-flop.

Toggles every time CNTR overflows

CPT: Compare toggle flip-flop.

Toggles every time PR equals CNTR.

S: Sign flag. Set to 1 when CNTR underflows.

Reset to 0 when CNTR overflows

E: Error flag. Set to 1 when excessive noise is present at the count inputs in quadrature mode. Irrelevant in nonquadrature mode.

U/D': Up/Down flag. Set to 1 when counting up

And reset to 0 when counting down

IDX: Index. Set to 1 when selected index input is at active level.

0: Not used. Always reset to 0.

Reset and Load Signal Decoders (Write to Control Address)

The following functions can be performed by writing to the control address for that axis. Note that bits 5 and 6 define the register and should always be zero when writing to the RLD register.

RLD Byte Defined

7 6 5 4 3 2 1 0

X

0

0

X

X

X

X

0

NOP

X

0

0

X

X

X

X

1

Reset BP

X

0

0

X

X

0

0

X

NOP

X

0

0

X

X

0

1

X

Reset CNTR

X

0

0

X

X

1

0

X Reset BT, CT, CPT, S

X

0

0

X

X

1

1

X

Reset E

X

0

0

0

0

X

X

X

NOP

X

0

0

0

1

X

X

X Transfer PR to CNTR

X

0

0

1

0

X

X

X Transfer CNTR to OL

X

0

0

1

1

X

X

X Transfer PR0 to PSC

0

0

0

X

X

X

X

X Select the RLD addressed by X'/Y input

1

0

0

X

X

X

X

X Select both XRLD and YRLD or ZRLD and WRLD together

8 2IQEC2/43798 Manual

B&B Electronics --PO Box 1040--Ottawa, IL 61350 PH (815)433-5100--FAX (815)433-5105