Presettable 8-bit counter circuit
Source: InternetPublisher:黄土马家 Keywords: counter Updated: 2024/10/14
Figure 2 is the logic structure of 74LS164. It has two serial data input terminals, which can be used in parallel, or one of them can be used as a data input enable terminal. The input serial data is shifted and latched at the rising edge of the clock.
Figure 3 shows the pinout of 74LS164. The pin functions of 74LS164 are: A1 and A2 are serial data input terminals, QA to QH are 8-bit parallel data output terminals. The rising edge of the clock input terminal is valid, and the falling edge of the reset terminal is valid.
The tasks completed by the AT89S51 microcontroller are: (1) Scan the keyboard to obtain the required preset data. (2) Send the count value to the 8-bit LED display for static display. (3) Perform output control.
Software design ideas and solutions
First, check whether the keyboard is pressed. If it is pressed, the key flag is 1, otherwise it is 0. Then check the s9 key. If the s9 key is pressed, the working flag set_flag is inverted (0 or 1). Later, the program counts, displays the count, controls the output, or scans the keys S1 to S8, displays the preset value, etc. according to the working flag. In this design, keys S10 to S16 are not used. For programming convenience, the 8-bit count value and the 8-bit preset value are
The values are stored in 8 variables. Although the RAM utilization is not high, it is easy for beginners to understand. When the preset value is displayed, the decimal point of the lowest digital tube on the display is lit to show the difference with the displayed count value. When the count value is equal to the preset value, the output (P3.4) is activated to control the load (motor, etc.) to act. Figure 4 is the main program state flow.
- Why Do Amplifier Fuses Blow? How Do You Prevent Amplifier Fuses from Blowing?
- Important things to know about PCB routing and how to design the right routing for your PCB
- What types of force sensors are there?
- Using an Op Amp to Drive a Simple and Practical Power Amplifier
- Touch circuit design and analysis
- LED Night Light
- An example of proportional integral circuit diagram
- AD108 frequency multiplier capable of inputting asymmetric square wave
- The quadruple frequency circuit composed of CH7555
- Simple and easy to make energy-saving LED flashlight
- traffic light circuit
- Fish tank intermittent oxygenation timer circuit
- Revolution or pitch counting circuit
- Adjustable precision stepper motor control circuit
- Simple long delay timer circuit
- Light intensity detection circuit diagram using counter
- High voltage Geiger counter power circuit
- CNC machine tool conversion counter and decoding circuit
- High Voltage Geiger Counter Power Supply
- Cycle counter display