4 Digit Up/Down Counter kit QK129

SKU
QK129
In stock
$30.95
Reward Points Earning 3points for this item
Applies only to registered customers, may vary when logged in.
-
+
Overview

This 4 digit up/down counter kit uses a single micro-controller.
Atmel AVR 90S1200.
Reset, up, down, disable and overflow to a second counter.
9 - 15V operation.
4 digit multiplexed display.
Oscillator contained within the micro.

INTRODUCTION
4 Digit Up Down Counter KitThis is a low cost 4-digit Up/Down counterCount range is from 0000, 1, 2 & to 9999 (counting up) or 0000, 9999, 9998, &. 0001 (counting down). The Overflow output pulses low when the count wraps around to zero. This output allows two counters to be connected together to make an 8 digit counter. The counter should really be only used for counting up or down in any particular application. However, if you know the count will not get near 9000 then you could connect the DOWN pins as required so that combined up/down readings will be summed. A later version of this counter will indicate if the count is positive or negative using a minus sign.ᅠ There are 5 pairs of pins:

RESET
CLOCK
DOWN
DISABLE
OVERFLOW

The right hand pin of every pair is a ground pin. This can be checked by looking at the back of the PCB. A track joins all 5 right hand pins together (when looked at from the front.) All inputs are normally pulled high by the counter circuitry. The function of each pin pair may be driven by simple "make" contacts between the high and the low pin. That is, they are touched together. This can be from switches, relays, open collector outputs or just putting a jumper across two pins The counter is triggered by a negative edge on its CLOCK input. That is, the CLOCK positive pin is momentarily connected to ground. The Clock input is debounced in the software to prevent false triggering when mechanical switches inputs are used. The debounce time is approx 15msec for each low/high or high/low transition, giving a maximum count rate of 30 to 35 counts per second. The counters may be easily mounted together so the displays can merge together. You can work out for yourself how many months this dual unit will count for before an overflow is generated. A DOWN input controls whether the counter counts up or down. When nothing is connected the counter counts up.ᅠ

The
DISABLE input, when low, prevents any counting at all.

The
RESET input resets the counter to 0000.

The
OVERFLOW output pulses low when the counter reaches 0000. The output pulse width is set at 25mS. However, this may vary a bit depending on the IC (see "Circuit Description  Note").

POWER SUPPLY

A 9 to 15V DC supply is required to power the kit, which has a current consumption of 20mA to 40mA, depending on the number displayed. The kit is constructed on single-sided printed circuit board using Protel for DOS.

CONSTRUCTION

Start with the lowest height components first like the resistors, diodes and IC socket. Next add the small capacitorsᅠ and transistors. Lastly are the electrolytic capacitor and display. The electrolytic capacitor, diodes and transistors need to be inserted the correct way around. These are marked on the PCB overlay. Space is provided so the electrolytic capacitor may be laid on its side.

CIRCUIT DESCRIPTION

The circuit used in this kit uses only one IC  the AT90S1200. It is one of the AVR family of RISC based microcontrollers from ATMEL. The PDF data sheet can be viewed at "www.atmel.com"The IC is preprogrammed. Using a microcontroller greatly reduces the component count while providing more features than could be found using dedicated logic ICs.ᅠ Cost is also lower. The AT90S1200 was the choice in this kit because it has an internal RC oscillator, eliminating the need for an external crystal and loading capacitors. NOTE: The speed of this internal oscillator may vary from chip to chip so the counting speeds may vary a bit. The display is a single unit, common anode LED, MUX (multiplexed) display. This means that the anodes of every segment in a digit are connected together (internally) while the cathodes of like segments in each digit are tied to a common 7-segment bus line (A, B, C, etc). This minimizes the number of pins needed to drive the display but requires a more complex method to do it. Multiplexing is a technique where each display is "active" for a short period of time. In this kit, each digit is turned ON once every 8mS for a period of 1mS. There is an OFF time of 1mS between digits. Resistors R1-7 limit the maximum current that can flow through each segment. Transistors Q1-4 provide power to each digit. Each input to the IC is connected via an RC network. This RC network provides some protection against high frequency noise. For the values used the time constant is approx. 20uS. Shorter duration pulses will not get through. Transistor Q5 provides an active low, open collector overflow signal. Zener diode Z1 protects the transistor against high voltage spikes if it is used to drive an inductive load like a relay. The circuitry is powered by IC2, a 5V regulator. Diode D1 protects against polarity reversal on its input. Male and female right-angle connectors have been provided to ease connecting to the Counter to external circuitry.

SOFTWARE

We have not provided the source code. In outline the software is arranged along the following lines: Initialization is only executed once when the counter is powered up or reset. It sets up the I/O ports and internal flags and registers and sets the counter output to 0000.

Timer Overflow Interrupts occur every 200uS. They are used to update other software timers & refresh the display. Main Loop is where the various inputs are checked. If a valid clock input occurs and the disable input is not active then the count up or count down routine is called depending on the direction input. Count Up and Count Down routines which increment or decrement internal registers that are used to hold the count value. The internal count is stored as a BCD value.ᅠ This eliminates the need to do a binary to BCD conversion before displaying the result. These routines also detect any counter overflow and pulse the Overflow output if necessary.ᅠ BCD to 7-Segment Conversion takes the current count value, converts it to seven segment data values and saves it in separate registers. These registers are used by the timer interrupt routine to display the count value.