Hytec Electronics Ltd.

 

 

 PCI 5380 TWO-CHANNEL ROTARY ENCODER INTERFACE WITH UP/DOWN COUNTER

Introduction 

This card is designed to replace the original ISA card designed for the IBM XT computer in 1987 by Tony Cosgrove of Daresbury Lab. Signals from two rotary incremental encoders are received and fed to up/down counters readable from the PCI bus.

Functions

The card uses a PLX Technology PCI9052 bridge chip to handle and decode PCI transactions. The card requests an area of I/O space into which it decodes read and write commands for on-board resources.

The signals from the two encoders in the form of either clock and up/down signals or the raw Phase A and Phase B signals are fed to 24-bit up/down counters formed in an FPGA chip. The counters can be read at any time by the PCI bus. The counters can be cleared to zero by a write command. The maximum rate of counting is 100KHz

Mode of operation

The suggested mode of operation for this system is based on polling. After a power-on-reset or a counter clear command, the counters will read zero. Any movement of the control device will result in the counter incrementing or decrementing. It is proposed that software read the counter at regular intervals, perhaps every 20 milliseconds, to see if the value is non-zero. Once a non-zero value has been detected, the poll should continue until the movement has stopped. The time taken for this will need to be determined by experiment. Once the end of a movement has been noted, the counter can be cleared and the process restarted.

PCI Bus Interface

When the card is fitted into a PC, the BIOS will detect it and assign resources as requested by the card. The resources are in the form of I/O and memory areas (and possibly an interrupt). One of the I/O areas is used for access to the on-board counter. It is the responsibility of the host software to determine the base address for this I/O area using the card’s manufacturer and model identifiers. Hytec’s manufacturer ID is 1196h and the board’s model number ID is 5380h.

The card has four registers in this I/O area, which are the top and bottom halves of the 24-bit counters, starting at the base address. They can be read at any time as a 16-bit value and an 8-bit value, and any write at the lower address will clear the corresponding counter.

Typical Resources:

Memory area for access to configuration registers.           Not used

I/O area for access to configuration registers.                 Not used

I/O area for 8-bit access to on-board user registers.        Not used

I/O area for 16-bit access to on-board user registers.      Used for counters (see below).


 
Address                     Contents
Base address            Low 16 bits of encoder 1 counter
Base address +2      Top 8 bits of encoder 1 counter
Base address +4      Low 16 bits of encoder 2 counter
Base address +6      Top 8 bits of encoder 2 counter

Mode selection

The user can select either Phase A/Phase B or Clock/direction operation for each channel by using on-board links:

LK1     IN         Counter 1 in clock/direction mode

LK1     OUT    Counter 1 in phase A/phase B mode

LK2     IN         Counter 2 in clock/direction mode

LK2     OUT    Counter 2 in phase A/phase B mode

Connections

The card uses the same I/O connection as the old ISA card, which was a 25-way Cannon socket, wired as follows:

Pin  

1                              Encoder 1 clock signal (TTL)/Phase A                    CO1 (50 way) pin 3

2                              Encoder 1 up/down signal (TTL)/Phase B               CO1 (50-way) pin 2

4                              Encoder 2 up/down signal (TTL)/Phase B               CO1 (50-way) pin 5

14, 16, 18, 20            VCC                                                                 IC6 pin 20

15, 17, 19, 21            GND.                                                                CO1 (50-way) pins 7, 10.

3                              Encoder 2 clock signal (TTL)/Phase A                   CO1 (50-way) pin 6

Signal Standards

All input signals are standard TTL levels with a 1K ohm pull-up to 5 volts.

 

HYTEC Head Office
Post : 5 Cradock Road, Reading, Berkshire, RG2 0JT, England.
Phone : +44 (0)118 9757770
Fax : +44 (0)118 9757566

Office





HYTEC HOME PAGE

Copyright © 2004 [Hytec Electronics Ltd]. All rights reserved.
Information in this document is subject to change without notice.
Other products and companies referred to herein are trademarks or registered
trademarks of their respective companies or mark holders.
 

Last modified: September 24, 2008