Design of coding, decoding and display experimental circuit based on 51 single chip microcomputer

Publisher:salahc1983Latest update time:2011-11-11 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

a.JPG

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.

b.JPG [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.

c.JPG


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.

d.JPG


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:
e.JPG

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.

g.jpg

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.

Reference address:Design of coding, decoding and display experimental circuit based on 51 single chip microcomputer

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

The A13 chip in Apple's Studio Display has excessive performance
       At Apple’s high-energy spring conference, every time a new product was introduced, I silently gave an evaluation in my heart: iPhone SE, a regular upgrade; iPad Air, a regular upgrade; M1 Ultra, wow, so powerful; Mac Studio, if you have money, you can buy one.   Only when the Studio Display appeared did I not m
[Mobile phone portable]
The A13 chip in Apple's Studio Display has excessive performance
Aledia wins double award: "French Tech 120" and Blue NOVA win Display Week awards
Beijing, China – May 30, 2024 – Aledia, a pioneer in nanowire and 3D silicon-based microLED technologies for next-generation displays, today announced two major achievement awards, further solidifying its leadership in the display industry: French Tech 120 selection: Named one of the French sta
[Industrial Control]
Aledia wins double award:
Studio Display camera receives "bad reviews" and Apple promises software fix
The first reviews of Apple's new Studio Display have surfaced, and one common thread is that the image quality from the built-in camera is less than satisfactory. The Studio Display is equipped with a 12-megapixel ultra-wide-angle front-facing camera that can be used for FaceTime calls. While the camera is a welcome
[Mobile phone portable]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号