Homemade pulse counter with program control. Pulse counter with memory on a microcontroller

Everyone knows why a microcalculator exists, but it turns out that in addition to mathematical calculations, it is capable of much more. Please note that if you press the “1” button, then “+” and then press “=”, then with each press of the “=” button the number on the display will increase by one. Why not a digital counter?

If two wires are soldered to the “=” button, they can be used as a counter input, for example, a turns counter for a winding machine. And after all, the counter can also be reversible; to do this, you must first dial a number on the display, for example, the number of turns of the coil, and then press the “-” button and the “1” button. Now, each time you press “=” the number will decrease by one.

However, a sensor is needed. The simplest option is a reed switch (Fig. 1). We connect the reed switch with wires parallel to the “=” button, the reed switch itself stands on the stationary part of the winding machine, and we fix the magnet on the movable one, so that during one revolution of the coil the magnet passes near the reed switch once, causing it to close.

That's all. You need to wind the coil, do “1+” and then with each turn, that is, with each turn the display readings will increase by one. You need to unwind the coil - enter the number of turns of the coil on the microcalculator display, and make “-1”, then with each revolution of unwinding the coil, the display readings will decrease by one.

Fig.1. Connection diagram of the reed switch to the calculator.

And, suppose you need to measure a large distance, for example, the length of a road, the size of a plot of land, the length of a route. We take a regular bicycle. That's right - we attach a non-metallic bracket with a reed switch to the fork, and we attach the magnet to one of the spokes of the bicycle wheel. Then, we measure the circumference of the wheel, and express it in meters, for example, the circumference of the wheel is 1.45 meters, so we dial “1.45+”, after which with each revolution of the wheel the display readings will increase by 1.45 meters, and as a result, the display will show the distance traveled by the bike in meters.

If you have a faulty Chinese quartz alarm clock (usually their mechanism is not very durable, but the electronic board is very reliable), you can take a board from it and, according to the circuit shown in Figure 2, make a stopwatch out of it and a calculator.

Power is supplied to the alarm clock board through a parametric stabilizer on the HL1 LED (the LED must have a direct voltage of 1.4-1.7V, for example, red AL307) and resistor R2.

The pulses are generated from the control pulses of the stepper motor of the clock mechanism (the coils must be disconnected, the board is used independently). These pulses travel through diodes VD1 and VD2 to the base of transistor VT1. The alarm board supply voltage is only 1.6V, while the pulse levels at the outputs for the stepper motor are even lower.

For the circuit to work properly, diodes with a low level of forward voltage, such as VAT85, or germanium are required.

These pulses arrive at the transistor switch at VT1 and VT2. The collector circuit VT2 includes the winding of a low-power relay K1, the contacts of which are connected in parallel to the “=” button of the microcalculator. When there is +5V power, the contacts of relay K1 will close at a frequency of 1 Hz.

To start the stopwatch, you must first perform the “1+” action, then turn on the power to the pulse shaper circuit using switch S1. Now, with every second, the display readings will increase by one.

To stop counting, simply turn off the power to the pulse shaper using switch S1.

In order to have a count for reduction, you must first enter the initial number of seconds on the microcalculator display, and then do the “-1” action and turn on the power to the pulse shaper with switch S1. Now, with every second, the display readings will decrease by one, and from them you can judge how much time is left until some event.

Fig.2. Scheme for turning a Chinese hanger into a stopwatch.

Fig.3. Circuit diagram of an IR beam intersection counter using a calculator.

If you use an infrared photo sensor that works at the intersection of the beam, you can adapt the microcalculator to count some objects, for example, boxes moving along a conveyor belt, or by installing the sensor in the aisle, count people entering the room.

A schematic diagram of an IR reflection sensor for working with a microcalculator is shown in Figure 3.

The IR signal generator is made on an A1 chip of type “555” (integrated timer). It is a pulse generator with a frequency of 38 kHz, at the output of which an infrared LED is switched on. The generation frequency depends on the C1-R1 circuit; when setting up by selecting resistor R1, you need to set the frequency at the output of the microcircuit (pin 3) to close to 38 kHz. The HL1 LED is placed on one side of the passage, putting an opaque tube on it, which must be precisely aimed at the photodetector.

The photodetector is made on the HF1 chip - this is a standard integrated photodetector of the TSOP4838 type for remote control systems for TVs and other home appliances. When a beam from HL1 hits this photodetector, its output is zero. In the absence of a beam - one.

Thus, there is nothing between HL1 and HF1 - the contacts of relay K1 are open, and at the moment of the passage of any object, the relay contacts are closed. If you perform the “1+” action on the microcalculator, then with each passage of an object between HL1 and HF1, the microcalculator display readings will increase by one, and from them you can judge how many boxes were shipped or how many people entered.

Kryukov M.B. RK-2016-01.

Operating principle

The initial state is the zero level at all trigger outputs (Q 1 – Q 3), i.e. digital code 000. In this case, the most significant digit is the output Q 3. To transfer all flip-flops to the zero state, the inputs of the R flip-flops are combined and the required voltage level is applied to them (i.e., a pulse that resets the flip-flops). This is essentially a reset. Input C receives clock pulses that increase the digital code by one, i.e. after the arrival of the first pulse, the first trigger switches to state 1 (code 001), after the arrival of the second pulse, the second trigger switches to state 1, and the first to state 0 (code 010), then the third, etc. As a result, such a device can count up to 7 (code 111), since 2 3 – 1 = 7. When all the outputs of the triggers are set to ones, they say that the counter is overflowed. After the arrival of the next (ninth) pulse, the counter will reset to zero and everything will start from the beginning. In the graphs, changes in trigger states occur with a certain delay t h. At the third digit the delay is already tripled. The delay that increases with the number of bits is a disadvantage of counters with serial transfer, which, despite their simplicity, limits their use in devices with a small number of bits.

Classification of meters

Counters are devices for counting the number of pulses (commands) received at their input, storing and storing the counting result, and issuing this result. The main parameter of the counter is the counting module (capacity) Kc. This value is equal to the number of stable states of the counter. After the arrival of the Kc pulses, the counter returns to its original state. For binary counters Kс = 2 m, where m is the number of counter bits.

In addition to Kc, important characteristics of the meter are the maximum counting frequency fmax and the settling time tset, which characterize the speed of the meter.

Tst is the duration of the transition process of switching the counter to a new state: tset = mttr, where m is the number of digits, and ttr is the trigger switching time.

Fmax is the maximum frequency of input pulses at which pulse loss does not occur.

By type of operation:

– Summing;

– Subtractive;

– Reversible.

In a summing counter, the arrival of each input pulse increases the counting result by one, in a subtractive counter it decreases by one; In reversing counters, both summation and subtraction can occur.

By structural organization:

– consistent;

– parallel;

– series-parallel.

In a serial counter, the input pulse is supplied only to the input of the first digit; the output pulse of the preceding digit is supplied to the inputs of each subsequent digit.

In a parallel counter, with the arrival of the next counting pulse, switching of triggers upon transition to a new state occurs simultaneously.

The series-parallel circuit includes both of the previous options.

In order of state changes:

– with a natural order of counting;

– with an arbitrary counting order.

Modulo counting:

– binary;

– non-binary.

The counting module of a binary counter is Kc=2, and the counting module of a non-binary counter is Kc= 2m, where m is the number of counter bits.

Summing serial counter

Fig.1. Summing serial 3-bit counter.

The triggers of this counter are triggered by the falling edge of the counting pulse. The input of the high digit of the counter is connected to the direct output (Q) of the low adjacent digit. The timing diagram of the operation of such a counter is shown in Fig. 2. At the initial moment of time, the states of all flip-flops are equal to log.0, respectively, at their direct outputs there is log.0. This is achieved by means of a short-term log.0 applied to the inputs of asynchronous setting of flip-flops to log.0. The general state of the counter can be characterized by a binary number (000). During counting, logic 1 is maintained at the inputs of asynchronous trigger installation in log.1. After the arrival of the trailing edge of the first pulse, the 0-bit switches to the opposite state - log.1. The leading edge of the counting pulse appears at the 1-bit input. Counter status (001). After the falling edge of the second pulse arrives at the input of the counter, the 0-bit switches to the opposite state - log.0, and the falling edge of the counting pulse appears at the input of the 1-bit, which switches the 1-bit to log.1. The general status of the counter is (010). The next falling edge at the 0-bit input will set it to logic 1 (011), etc. Thus, the counter accumulates the number of input pulses arriving at its input. When 8 pulses arrive at its input, the counter returns to its original state (000), which means the counting coefficient (CFC) of this counter is 8.

Rice. 2. Timing diagram of a serial adding counter.

Subtractive serial counter

The triggers of this counter are triggered by the falling edge. To implement the subtraction operation, the counting input of the high-order digit is connected to the inverse output of the adjacent low-order digit. The triggers are preliminarily set to log.1 (111). The operation of this counter is shown in the timing diagram in Fig. 4.

Rice. 1 Serial subtractive counter

Rice. 2 Timing diagram of a serial subtractive counter

Reversible serial counter

To implement an up/down counter, it is necessary to combine the functions of a adding counter and the functions of a subtracting counter. The diagram of this counter is shown in Fig. 5. The “sum” and “difference” signals are used to control the counting mode. For the summation mode, “sum” = log.1, “0” is short-term log.0; “difference” = log.0, “1” - short-term log.0. In this case, elements DD4.1 and DD4.3 allow the supply of signals from the direct outputs of triggers DD1.1, DD1.2 to the clock inputs of triggers DD1.2, DD2.1 through elements DD5.1 ​​and DD5.2, respectively. In this case, the elements DD4.2 and DD4.4 are closed, there is a log 0 at their outputs, so the action of the inverse outputs does not in any way affect the counting inputs of the flip-flops DD1.2, DD2.1. Thus, the summation operation is implemented. To implement the subtraction operation, log.0 is supplied to the “sum” input, and log.1 to the “difference” input. In this case, elements DD4.2, DD4.4 allow signals from the inverse outputs of triggers DD1.1, DD1.2 to be supplied to the inputs of elements DD5.1, DD5.2, and, accordingly, to the counting inputs of triggers DD1.2, DD2.1. In this case, the elements DD4.1, DD4.3 are closed and the signals from the direct outputs of the triggers DD1.1, DD1.2 do not in any way affect the counting inputs of the triggers DD1.2, DD2.1. Thus, the subtraction operation is implemented.

Rice. 3 Serial up/down 3-bit counter

To implement these counters, you can also use triggers that are triggered by the rising edge of the counting pulses. Then, when summing, a signal from the inverse output of the adjacent low-order bit must be supplied to the counting input of the high-order digit, and when subtracting, vice versa, the counting input must be connected to the direct output.

The disadvantage of a serial counter is that as the bit depth increases, the installation time (tset) of this counter increases proportionally. The advantage is ease of implementation.

Rice. 3 – Reversing counter

There are two inputs for counting pulses: “+1” – for increase, “-1” – for decrease. The corresponding input (+1 or -1) is connected to input C. This can be done using an OR circuit if you insert it in front of the first flip-flop (the output of the element is to the input of the first flip-flop, the inputs are to buses +1 and -1). The weird stuff between the triggers (DD2 and DD4) is called the AND-OR element. This element is composed of two AND elements and one OR element, combined in one housing. First, the input signals on this element are logically multiplied, then the result is logically added.

The number of inputs of the AND-OR element corresponds to the number of the digit, i.e. if the third digit, then three inputs, the fourth - four, etc. The logic circuit is a two-position switch controlled by the direct or inverse output of the previous trigger. At log. 1 at the direct output, the counter counts pulses from the “+1” bus (if they arrive, of course), with a log. 1 on the inverse output – from the “-1” bus. The AND elements (DD6.1 and DD6.2) form the transfer signals. At output >7, the signal is generated when code 111 (number 7) and the presence of a clock pulse on bus +1, at the output<0 сигнал формируется при коде 000 и наличии тактового импульса на шине -1.

All this, of course, is interesting, but it looks more beautiful in microcircuit design:

Rice. 4 Four-bit binary counter

Here is a typical preset meter. CT2 means that the counter is binary; if it is decimal, then CT10 is set; if it is binary-decimal, it is CT2/10. Inputs D0 – D3 are called information inputs and are used to write any binary state to the counter. This state will be displayed at its outputs and the countdown will begin from it. In other words, these are preset inputs, or simply presets. Input V is used to enable code recording on inputs D0 – D3, or, as they say, enable preset. This input may also be designated by other letters. Preliminary recording into the counter is made when a write enable signal is sent at the moment the pulse arrives at input C. Input C is clocked. Impulses are pushed here. The triangle means that the counter is triggered by the fall of the pulse. If the triangle is rotated 180 degrees, i.e. with its back towards the letter C, then it is triggered by the edge of the pulse. Input R is used to reset the counter, i.e., when a pulse is applied to this input, logs are set at all counter outputs. 0. The PI input is called carry input. The output p is called the carry output. A signal is generated at this output when the counter overflows (when all outputs are set to logic 1). This signal can be applied to the carry input of the next counter. Then, when the first counter overflows, the second one will switch to the next state. Outputs 1, 2, 4, 8 are simply outputs. They generate a binary code corresponding to the number of pulses received at the input of the counter. If the conclusions have circles, which happens much more often, then they are inverse, i.e. instead of log. 1 is supplied log. 0 and vice versa. The operation of meters together with other devices will be discussed in more detail later.

Parallel totalizer

The operating principle of this counter is that the input signal containing counting pulses is applied simultaneously to all bits of this counter. And setting the counter to the log.0 or log.1 state is controlled by the control circuit. The circuit of this counter is shown in Fig. 6

Rice. 4 Parallel accumulating counter

The counter bits are triggers DD1, DD2, DD3.

Control circuit – element DD4.

The advantage of this counter is its short installation time, which does not depend on the digit capacity of the counter.

The disadvantage is the complexity of the circuit as the counter capacity increases.

Parallel carry counters

To increase performance, a method of simultaneously generating a transfer signal for all bits is used. This is achieved by introducing AND elements, through which clock pulses are sent immediately to the inputs of all bits of the counter.

Rice. 2 – Parallel carry counter and graphs explaining its operation

Everything is clear with the first trigger. A clock pulse will pass to the input of the second trigger only when there is a log at the output of the first trigger. 1 (a feature of the AND circuit), and to the input of the third - when there is a log at the outputs of the first two. 1, etc. The response delay on the third trigger is the same as on the first. Such a counter is called a parallel carry counter. As can be seen from the diagram, as the number of bits increases, the number of logs increases. AND elements, and the higher the rank, the more inputs the element has. This is a disadvantage of such counters.

Development of a schematic diagram

Pulse former

A pulse shaper is a device necessary to eliminate contact bounce that occurs when mechanical contacts are closed, which can lead to improper operation of the circuit.

Figure 9 shows diagrams of pulse formers from mechanical contacts.

Rice. 9 Pulse formers from mechanical contacts.

Display block

LEDs must be used to display the counting result. To carry out such output of information, you can use the simplest scheme. The diagram of the LED display unit is shown in Figure 10.

Rice. 10 LED display unit.

Development of CCS (combination control circuit)

To implement this counter from the TTLSh series of K555 microcircuits, I chose:

two K555TV9 microcircuits (2 JK triggers with installation)

one K555LA4 microcircuit (3 3I-NOT elements)

two K555LA3 microcircuits (4 2I-NOT elements)

one K555LN1 chip (6 inverters)

These chips provide a minimum number of packages on a printed circuit board.

Drawing up a block diagram of the meter

Block diagram is a set of meter blocks that perform some function and ensure normal operation of the meter. Figure 7 shows the block diagram of the meter.

Rice. 7 Block diagram of the meter

The control unit performs the function of sending a signal and controlling triggers.

The counting block is designed to change the state of the counter and save this state.

The display unit displays information for visual perception.

Drawing up a functional diagram of the meter

Functional diagram – internal structure of the meter.

Let's determine the optimal number of triggers for a non-binary counter with a counting coefficient Kc=10.

M = log 2 (Kc) = 4.

M = 4 means to implement a binary decimal counter, 4 flip-flops are needed.

The simplest single-digit pulse counters

The simplest single-digit pulse counter can be a JK flip-flop and a D flip-flop operating in counting mode. It counts input pulses modulo 2 - each pulse switches the trigger to the opposite state. One trigger counts up to two, two connected in series count up to four, n triggers count up to 2n pulses. The counting result is generated in a given code, which can be stored in the counter’s memory or be read by another digital decoder device.

The figure shows the circuit of a three-bit binary pulse counter built on a JK flip-flop ax K155TB1. Mount such a counter on a breadboard panel and connect LED (or transistor - with an incandescent lamp) indicators to the direct outputs of the triggers, as was done before. Apply a series of pulses with a repetition frequency of 1 ... 2 Hz from the test generator to the input C of the first trigger of the counter and plot the operation of the counter using the light signals of the indicators.

If at the initial moment all the triggers of the counter were in the zero state (you can set the button switch SB1 “Set.0”, applying a low level voltage to the input R of the triggers), then upon the decline of the first pulse (Fig. 45.6) the trigger DD1 will switch to single state - a high voltage level will appear at its direct output (Fig. 45, c). The second pulse will switch the DD1 trigger to the zero state, and the DD2-B trigger to the single state (Fig. 45, d). As the third pulse falls, triggers DD1 and DD2 will be in the one state, and trigger DD3 will still be in the zero state. The fourth pulse will switch the first two triggers to the zero state, and the third to the single state (Fig. 45, d). The eighth pulse will switch all triggers to the zero state. When the ninth input pulse falls, the next cycle of operation of the three-digit pulse counter will begin.

Studying the graphs, it is easy to notice that each high digit of the counter differs from the low digit by twice the number of counting pulses. Thus, the period of the pulses at the output of the first trigger is 2 times greater than the period of the input pulses, at the output of the second trigger - 4 times, at the output of the third trigger - 8 times. Speaking in the language of digital technology, such a counter operates in a 1-2-4 weight code. Here, the term “weight” refers to the amount of information received by the counter after setting its triggers to the zero state. In devices and instruments of digital technology, four-digit pulse counters operating in the weight code 1-2-4-8 are most widely used. Frequency dividers count the input pulses to a certain state specified by the counting coefficient, and then form a trigger switching signal to the zero state, again begin counting the input pulses to the specified counting coefficient, etc.

The figure shows the circuit and graphs of the operation of a divider with a counting factor of 5, built on JK flip-flops. Here, the already familiar three-bit binary counter is supplemented with a logical element 2І-NOT DD4.1, which sets the counting factor of 5. It happens like this. During the first four input pulses (after setting the triggers to the zero state using the SB1 “Set 0” button), the device operates as a regular binary pulse counter. In this case, a low voltage level operates at one or both inputs of element DD4.1, so the element is in a single state.

Upon the decline of the fifth pulse, a high voltage level appears at the direct output of the first and third triggers, and therefore at both inputs of the DD4.1 element, switching this logical element to the zero state. At this moment, a short low-level pulse is formed at its output, which is transmitted through the diode VD1 to the R input of all flip-flops and switches them to the initial zero state.

From this moment the next cycle of the counter operation begins. Resistor R1 and diode VD1, introduced into this counter, are necessary in order to prevent the output of element DD4.1 from being shorted to the common wire.

You can check the operation of such a frequency divider by applying pulses with a frequency of 1 ... 2 Hz to the input C of its first trigger, and connecting a light indicator to the output of the DD3 trigger.

In practice, the functions of pulse counters and frequency dividers are performed by specially designed microcircuits with a high degree of integration. In the K155 series, for example, these are counters K155IE1, K155IE2, K155IE4, etc.

In amateur radio developments, the K155IE1 and K155IE2 microcircuits are most widely used. Conventional graphic symbols of these counter microcircuits with the numbering of their outputs are shown in Fig. 47.

The K155IE1 microcircuit (Fig. 47a) is called a ten-day pulse counter, that is, a counter with a counting factor of 10. It contains four triggers connected in series. The output (pin 5) of the microcircuit is the output of its fourth trigger. All flip-flops are set to the zero state by applying a high-level voltage simultaneously to both inputs R (pins 1 and 2), combined according to the AND element circuit (symbol “&”). Counting pulses, which must have a low level, can be applied to inputs C connected together (pins 8 and 9), also combined along I., or to one of them, if at this time the second has a high voltage level. With every tenth input pulse, the counter generates a low-level pulse equal in duration to the input pulse. Chip K155IE2 (Fig. 48b)

Binary-decimal four-digit counter. It also has four flip-flops, but the first one has a separate C1 input (pin 14) and a separate direct output (pin 12). The other three triggers are connected to each other so that they form a divider by 5. When the output of the first trigger (pin 12) is connected to the input C2 (pin 1) of the circuit of the remaining triggers, the microcircuit becomes a divider by 10 (Fig. 48, a), operating in code 1 -2-4-8, which is what the numbers at the outputs of the graphic designation of the microcircuit symbolize. To set the counter triggers to the zero state, a high level voltage is applied to both inputs R0 (pins 2 and 3).

Two combined inputs R0 and four separating outputs of the K155IE2 microcircuit allow you to build frequency dividers with division factors from 2 to 10 without additional elements. For example, if you connect pins 12 and 1, 9 and 2, 8 n 3 (Fig. 48, 6), then the counting factor will be 6, and when connecting pins 12 and 1, 11. 2 and 3 (Fig. 48, c) the counting factor will become 8. This feature of the K155IE2 microcircuit allows it to be used both as a binary pulse counter and as a frequency divider.

A digital pulse counter is a digital unit that counts the pulses arriving at its input. The counting result is generated by the counter in a given code and can be stored for the required time. Counters are built on triggers, and the number of pulses that the counter can count is determined from the expression N = 2 n – 1, where n is the number of triggers, and minus one, because in digital technology 0 is taken as the starting point. Counters are summative when the count goes towards increase, and the subtractive count goes towards decrease. If the counter can switch during operation from summation to subtraction and vice versa, then it is called reversible.

video of device operation

The circuit is assembled on a PIC16F628A microcontroller. It can count input pulses from 0 to 9999. The pulses are sent to the RA3 port line (SA1 button active level low). With each pulse, the indicator readings change by +1. After the 999th pulse, 0 is displayed on the indicator and the point at which the second thousand begins (the one on the right in the diagram) lights up, etc. So the counting can continue until the value 9999. After this, the counting stops. Button SA3 (port line RA1) is used to reset the readings to 0.

Pulse counter circuit with memory on a microcontroller

Initially, the circuit was designed to be powered by three AA batteries. Therefore, in order to save energy, the circuit includes an indication button to monitor the status of the meter SA2 (port line RA4). If this button is not needed, its contacts can be short-circuited. Pull-up resistors ranging from 1k to 10k can be used in the circuit. The INTRC I/O and PWRTE configuration bits are set. When the power is turned off, the counter readings are saved in the controller memory. When the indicator is off, the circuit remains operational when the power is reduced to 3.5 volts. Practice has shown that the battery charge is enough for almost a week of continuous operation of the circuit.


Meter printed circuit board


Photo of the counter

Schematic, MK firmware and printed circuit board in S-layout format in archive (15kb).

From the administrator. Resistors R1-R3 can be selected with a value of up to 10K.

Like flip-flops, counters do not necessarily need to be assembled manually from logical elements - today’s industry produces a wide variety of counters already assembled in microcircuit packages. In this article, I will not dwell on each counter chip separately (this is not necessary, and it will take too much time), but will simply briefly outline what you can count on when solving certain problems in digital circuitry. For those who are interested in specific types of counter chips, I can send them to my far from complete reference book on TTL and CMOS chips.

So, based on the experience gained in the previous conversation, we found out one of the main parameters of the counter - bit depth. In order for the counter to count up to 16 (including zero - this is also a number), we needed 4 digits. Adding each subsequent digit will exactly double the counter's capabilities. Thus, a five-bit counter can count up to 32, and a six-bit counter can count up to 64. For computer technology, the optimal bit depth is a multiple of four. This is not a golden rule, but still most counters, decoders, buffers, etc. are built four (up to 16) or eight-bit (up to 256).

But since digital circuitry is not limited to computers alone, counters with very different counting coefficients are often required: 3, 10, 12, 6, etc. For example, to build circuits for minute counters, we need a 60 counter, and it is easy to obtain by connecting a 10 counter and a 6 counter in series. We may also need a larger capacity. For these cases, for example, the CMOS series has a ready-made 14-bit counter (K564IE16), which consists of 14 D-flip-flops connected in series and each output except the 2nd and 3rd is connected to a separate pin. Apply pulses to the input, count and read, if necessary, the counter readings in binary numbers:

K564IE16

To facilitate the construction of counters of the required capacity, some microcircuits may contain several separate counters. Let's take a look at K155IE2 - BCD counter(in Russian – “counter up to 10, displaying information in binary code”):

The microcircuit contains 4 D-flip-flops, and 1 flip-flop (single-digit counter - divider by 2) is assembled separately - has its own input (14) and its own output (12). The remaining 3 flip-flops are assembled in such a way that they divide the input frequency by 5. For them, the input is pin 1, outputs 9, 8,11. If we need a counter up to 10, then we simply connect pins 1 and 12, apply counting pulses to pin 14, and from pins 12, 9, 8, 11 we remove the binary code, which will increase to 10, after which the counters will be reset and the cycle will repeat. The K155IE2 composite counter is no exception. A similar composition has, for example, K155IE4 (counter up to 2+6) or K155IE5 (counter up to 2+8):

Almost all counters have inputs for forced reset to “0”, and some have inputs for setting them to the maximum value. And finally, I just have to say that some counters can count back and forth! These are so-called reversible counters, which can switch for counting both to increase (+1) and decrease (-1). So he can, for example, BCD up/down counter K155IE6:

When pulses are applied to input +1, the counter will count forward, pulses at input -1 will decrease the counter readings. If, as the readings increase, the counter overflows (pulse 11), then before returning to zero, it will output a “transfer” signal to pin 12, which can be applied to the next counter to increase the capacity. Pin 13 has the same purpose, but a pulse will appear on it when the count passes through zero when counting in the opposite direction.

Please note that in addition to reset inputs, the K155IE6 microcircuit has inputs for writing an arbitrary number to it (pins 15, 1, 10, 9). To do this, it is enough to set any number 0 - 10 in binary notation at these inputs and apply a write pulse to input C.

This device is designed to count the number of revolutions of the shaft of a mechanical device. In addition to simple counting with indication on the LED display in decimal numbers, the counter provides information about the number of revolutions in a binary ten-bit code, which can be used when designing an automatic device. The counter consists of an optical speed sensor, which is an optocoupler consisting of a constantly glowing IR LED and a photodiode, between which there is a disk of opaque material in which a sector is cut out. The disk is attached to the shaft of a mechanical device, the number of revolutions of which must be counted. And, a combination of two counters - a three-digit decimal counter with output to seven-segment LED indicators, and a ten-digit binary counter. The counters operate synchronously, but independently of each other. The HL1 LED emits a continuous light stream, which enters the photodiode through a slot in the measuring disk. When the disk rotates, impulses are generated, and since there is only one slot in the disk, the number of these impulses is equal to the number of revolutions of the disk. The Schmitt trigger on D1.1 and D1.2 converts voltage pulses on R2, caused by a change in the photocurrent through the photodiode, into logic level pulses suitable for perception by counters of the K176 and K561 series. The number of pulses (number of disk revolutions) is simultaneously counted by two counters - a three-decade decimal counter on chips D2-D4 and a binary one on D5. Information about the number of revolutions is displayed on a digital display, composed of three seven-segment LED indicators H1-H3, and in the form of a ten-bit binary code, which is removed from the outputs of the counter D5. Resetting all counters to zero at the moment the power is turned on occurs simultaneously, which is facilitated by the presence of element D1.3. If you need a zero button, it can be connected in parallel with capacitor C1. If you need the reset signal to come from an external device or logic circuit, you need to replace the K561LE5 microcircuit with K561LA7, and disconnect its pin 13 from pin 12 and C1. Now zeroing can be done by applying a logical zero from an external logical node to pin 13 of D1.3. The circuit can use other seven-segment LED indicators similar to ALS324. If the indicators have a common cathode, you need to apply zero, not one, to pins 6 D2-D4. K561 microcircuits can be replaced with analogues of the K176, K1561 series or imported analogues. LED - any IR LED (from the remote control of the equipment). Photodiode - any of those used in remote control systems of TVs of the USCT type. The setting consists of setting the sensitivity of the photodiode by selecting the value of R2.

Radioconstructor No. 2 2003 p. 24

mob_info