beautypg.com

Measurement Computing USB-4301 User Manual

Page 18

background image

USB-4301 User's Guide

Functional Details

18

Not recycle

The counter will count from 10,000 to 0, and then start at 5,000 and count to 0, then stop. If you select an edge

gating option, and Recycle mode is active, the counter only resumes counting after TC when a new active gate

edge is received.

BCD/Binary mode

Most applications use the binary mode of counting. Binary mode causes the counter to always increment or

decrement by a value of 1. The counter can have a value from 0 to 65,535.

With binary mode, a 4-bit binary number is represented by the 16 decimal numbers 0 to 15: 0 = 0b0000, 1 =

0b0001,…, 9 = 0b1001, 10 = 0b1010,…, 15 = 0b1111. (0b is used to denote binary numbers). For the numbers

0-9, there are four binary bits to represent one decimal digit, and from 10-15, there are four binary bits to

represent two decimal digits.

However, in some applications, it is useful to maintain the four-bit-to-one-digit correspondence, so the numbers

0-9 remain the same, but 10-15 and up to 99 are represented by eight bits—four for each digit. The numbers

100-999 are represented by 12 bits, and 1000-9999 are represented by 16 bits. This makes it easy to decode long

binary numbers.

For example, 0b1001 0001 0000 1001 equals 9109 in BCD (Binary Coded Decimal) mode, and equals 37,129

in binary mode. In BCD mode, the counter can only contain values from 0 to 9999 instead of 0 to 65,535 as in

binary counting.

The "Special" gate

When you enable the Special gate option and specify gating, the gate can function as a hardware re-trigger of

the counting operation. When an active gate edge is received, the counter is reloaded from the Load register and

begins counting, even if the counter is already counting when the gate edge is received.

When you enable the Special gate option and disable gating, the Gate pin associated with the counter being

configured can select the reload source for the counter. This requires the counter be in Load and Hold reload

mode. If the gate pin is low, the counter is reloaded from the Load register. If the gate pin is high, the counter is

reloaded from the Hold register.

Output control

You can configure the output pin associated with a counter to behave in five ways:

Inactive with high impedance to ground.

Inactive with low impedance to ground.

Generate an active high pulse when the associated counter reaches TC.

Generate an active low pulse when the associated counter reaches TC.

Toggle its value every time the counter reaches TC.

This manual is related to the following products: