beautypg.com

Counters – Sensoray 626 User Manual

Page 16

background image

Sensoray Model 626 Instruction Manual

14

10. Counters

10.1 Overview

The Model 626 has six counters arranged in 3 pairs : 0A, 0B, 1A, 1B, 2A, and 2B. One of these pairs is
shown in Figure 6 P17. They can be used in pairs or “stand alone”. Each counter can be used with the
internal quadrature encoder interface for positioning systems, as timers using the internal clock, or as
external (hardware) or internal (software) event counters. When paired a 48 bit counter can be achieved
and development of functions like frequency counting is easy as one counter in the pair can feed the
other either as a count, clear or latch input.

The features include:

• Counters can be completely software driven.

• Counters can be driven from digital inputs 0-15.
• Counters can be driven from the internal clock creating timers.

• Counters can be driven from encoder inputs.

• Encoder input buffers interface directly to TTL, CMOS, or differential RS422 signals
• Quadrature decoder logic to detect and convert encoder edges into clock and direction signals.

• Encoder quadrature multiplier (x1, x2, x4)

• 24-bit up/down counters that can be pre-loaded by various triggers.
• Counters can be read on the fly or captured by various triggers to be read later.

• Selectable counter direction for timer and event counting modes.

• Index input or overflow count can re-load counter with preset values.
• Programmable interrupt on rollover or index pulse.

• 5 Volt encoder power is available at encoder connector.

10.1.1 Latches

From Figure 6 (Block diagram of a counter pair) it can be seen that there is 1 latch per pair of counters.
Counter A or B can cause it’s own count to be latched on receiving an index pulse or an overflow from
counter A can cause counter B’s count to be latched. These latches can be accompanied with an interrupt
and the value captured in the latch can be read later.
The latches can also be setup to latch as they are read. This allows the present value of the selected
counter to be read.

10.1.2 Clear/Pre-load

The system can be programmed so that an overflow from Counter A will clear counter B. This is useful
for frequency counting where counter B is latched & cleared at an interval determined by the time it
takes for counter A to overflow.
Both counters can be programmed so that an index or overflow from a counter will pre-load itself with
the contents of its pre-load register. This feature could be used to clear the counter by loading it with 0.
This feature would be used for setting up a programmable interval timer. Both the clear & pre-load can
be accompanied by an interrupt.