0 Introduction
In daily digital logic circuit experiments, the coding, decoding and display experimental circuit is a comprehensive application of the three circuits of coding, decoding and display. It plays an important role in the digital logic experimental circuit. During the experiment, the display result often jitters. After research, the main reason for this phenomenon is that the coding signal input of the coding circuit adopts the manual dial method, and the generated coding input signal is often unstable; in addition, the circuit control performance is poor and cannot achieve automatic reset. Therefore, it is necessary to improve the existing circuit. In the design of the circuit, the 89C51 single-chip microcomputer is used as the control circuit to automatically provide a stable coding input signal, and the stability of the display result and the circuit control performance are greatly improved, which improves the quality of teaching experiments.
1 Basic structure of the coding and decoding display experimental circuit
The basic structure of the coding and decoding display circuit is shown in Figure 1. It is mainly composed of a control circuit, a coding signal generator, a coding and decoding display circuit, etc. The control circuit generates a coding signal as the input signal of the coding and decoding display circuit, and the decoding circuit converts the coding signal into a corresponding seven-segment digital display signal and sends it to the LED digital tube for display.
2 System Hardware Design
The control system and encoding signal generator are implemented using the 89C51 single-chip microcomputer. The 89C51 has a high cost-effectiveness, uses a 12 MHz crystal oscillator, and has a 4 KB FLASH ROM inside, so there is no need to expand the program memory externally. The encoding and decoding circuit does not require a large amount of calculations and temporary data storage. The 128 B on-chip RAM inside the 89C51 can meet the requirements, and there is no need to expand the off-chip RAM. The system hardware design is shown in Figure 2.
[page]
2.1 Encoding signal generator circuit
The encoding signal is controlled by the internal programming of 89C51. The keyboard input "0~8" is sent to the encoder 74LSl47 from P0.0~P0.7 ports, and "9" is sent to the encoder from P2.0 port. The specific encoding is shown in Table 1.
2.2 Keyboard design
The keyboard adopts a 4×3 array structure design, P1.0~P1.3 is the high 4 bits of the keyboard scan, and P1.4~P1.6 is the low 4 bits. The design has "O~9", Rst (reset), and Ser (sequence). The column line is connected to the positive power supply through a resistor, and the I/O port of the microcontroller connected to the row line is used as the output end, while the I/O port connected to the column line is used as the input. When the key is not pressed, all output ends are high level, indicating that no key is pressed. The row line output is low level. Once a key is pressed, the input line will be pulled low. In this way, by reading the state of the input line, it can be known whether a key is pressed.
2.3 Encoding and decoding display circuit
The encoding and decoding display circuit is mainly composed of an encoder (74LS147), a six-phase inverter (74AC04), a decoder (74LS247), and a seven-segment LED digital tube. Pins 1 to 5 and 10 to 13 of the encoder 74LS147 are the encoding input terminals, which are valid at low level. Grounding can be used as low level input during experiments; pins 14, 6, 7, and 9 are encoding outputs (inverted code); pins 16 and 8
are the positive and negative poles of the power supply. Pins 6, 2, 1, and 7 of the decoder 74LS247 are decoding inputs (valid at high level); pins 9 to 15 are decoding outputs; pins 8 and 16 are the positive and negative poles of the power supply. The six-phase inverter (74AC04) is mainly used to solve the signal matching problem between the encoder 74HC147 and the decoder 74LS247. There are 6 groups of inputs and outputs, and only 4 of them are used. The seven-segment LED digital tube mainly displays the output status of the decoder.
The main principle of the circuit is that the input of 74LS147 is 011111111~111111110, and the 4-bit inverse code is obtained after encoding. It is inverted by 74AC04 and sent to 74LS247. 74LS247 drives the LED digital tube, which can display 0~9 when correct.
[page]
3 System software design
The software design consists of three parts: initialization, keyboard scanning, and encoding program. Initialization begins, and the P0 and P2 ports output the reset state value, and the LED does not display. Then the 4×3 array keyboard begins to scan. When it is determined that a key is pressed, the key jitter is removed by delay, and it is determined whether there is jitter. When it is determined that a key is pressed, the closed key is released and the key value is saved. The encoding program is called according to the key value, and the code corresponding to Table 1 is sent to the P0 and P2 ports for output. The main program flow chart is shown in Figure 3.
When the Ser (sequence) key is pressed, the code values 1 to 9 are sent to the PO and P2 ports in sequence and output at intervals of 0.5 s. The Ser code subroutine is as follows:
4 System simulation and debugging
Proteus is a complete embedded system software and hardware design simulation platform based on ProSpice mixed model simulator. The encoding and decoding display circuit can be easily debugged and simulated on this platform. The delay time is related to the selected single-chip microcomputer and the crystal oscillator used, so it should be paid attention to during debugging.
5 Conclusion
A coding and decoding display experimental circuit design is proposed. Its control system and coding signal generator are implemented by 89C51 single-chip microcomputer. According to the results of Pro-teus simulation and experimental debugging, the performance of the circuit is greatly improved. The circuit is easy to make and simple to operate. It has a certain promotion value in the digital logic circuit experimental teaching. The main shortcoming of the circuit is that it cannot realize automatic fault detection. If the circuit fault can be automatically detected, the circuit performance will be more perfect.
Previous article:Design of MP3 Solution Based on 51 Single Chip Microcomputer
Next article:Intelligent voltage-stabilized power supply based on single-chip microcomputer
Recommended ReadingLatest update time:2024-11-16 20:27
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【Qinheng Trial】8. FlashROM
- Design method of high-speed graphics frame storage using DSP+FPGA architecture
- Why can the defined pointer be used as an array?
- Have you ever used the YU4215 chip, SMD SO-8 package?
- Pingtouge RISC-V Development Board--STEP2--Intelligent Voltage and Current Acquisition Controller Design Preparation Part 1
- max30102 MCU selection
- Switch Mode Power Supply Board Layout Example
- How to use a signal source + power amplifier + oscilloscope to output a heart-shaped waveform? How to make a heart with LEDs?
- Altium Designer Common Component Library File
- LPC11U68 driver X-NUCLEO-IKS01A3