Commonly used displays in microcontrollers include LED light-emitting diode displays, LCD liquid crystal displays, CRT cathode ray displays, etc. The display structure of the LED display is segment display, that is, 7-bit segment display, 8-bit segment display, rice-shaped and other products, 8-bit segment The display has one more decimal point display digit dp than the 7-digit segment display. For example, LED displays commonly used in microcontroller technology applications such as digital tubes have one-digit digital tubes, two-digit digital tubes, and four-digit digital tubes. The display structure of the LCD monitor is a dot matrix display, that is, 8×8, 16×16, 32×32 and other products. The more digits in the dot matrix, the better the display effect. Commonly used LCD displays include LCD1602 and so on.
1. Structure and working principle of LED digital tube
The basic unit of the LED digital tube is a semiconductor light-emitting diode. The 7-segment LED digital tube is composed of 7 long strips of light-emitting diodes arranged in the character "日", starting from the top horizontal line and arranged clockwise with the letter a~ g means it can display tens digits from 0 to 9, as well as simple English letters such as l, o, a, g, etc. The 8-segment LED digital tube is based on the 7-segment and adds a dot in the lower right corner of the digital tube, represented by the letter dp, to display the decimal place.
According to the different connection forms of 8 light-emitting diodes, LED digital tubes can be divided into common anode and common cathode. The anodes of the 8 light-emitting diodes are connected together called a common anode LED digital tube; The cathodes are all connected together, which is called a common cathode LED digital tube. In order to make the light-emitting diode of the LED digital tube light up to display numbers or letters, for the common cathode LED digital tube, a high level must be input at the input end, that is, "1", then the light-emitting diode will light up, and a low level must be input at the input end. If it is "0", the light-emitting diode does not emit light, but the opposite is true for the LED digital tube with a common anode. For example: Taking the common cathode LED digital tube as an example, if the LED digital tube is allowed to display the number "5", the light-emitting diodes in segments b, c, f, and g are allowed to emit light and are assigned a value of "1", while the other segments a and d The light-emitting diodes in the , e, and dp segments do not emit light and are assigned a value of "0". The assignment result is 01101101B in the order of dp, g, f, e, d, c, b, and a, which is converted into a hexadecimal number of 0x5bH.
2. Principle and function of latch
The latches are all transparent D-type latches, and when enable (G) is high, the Q output will change with the data (D) input. When enabled low, the output will be latched at the established data level. The output control does not affect the internal working of the latch, that is, old data can be retained, and new data can be placed even when the output is turned off. .
If a latch is not added when using an LED digital tube, especially in the case of dynamic display, the display of the LED digital tube may jump irregularly. In addition, the use of latches can make the CPU's time occupancy rate lower, occupy less output ports of the microcontroller, and support port multiplexing. Therefore, in order to ensure the display signal effect of the LED digital tube, when using the LED digital tube, a latch is generally used. Commonly used latches include 74LS373, 74HC573, etc.
3. Function realization
It is composed of AT89C52 microcontroller produced by American ATMEL company, two 74HC573 latches, three two-digit digital tubes, reset circuit and crystal oscillator circuit. The P0 port is used to connect to the D port of the bit select and segment select latches respectively. The Q port of the segment select is connected to the a~dp of the LED digital tube. The Q port of the bit select is connected to the chip select port of the LED digital tube. . The bit selection terminal is connected to the microcontroller P2.0, and the segment selection terminal is connected to the microcontroller P2.1.
(1) Static display of LED digital tube
The static display of LED digital tubes means that multiple LED digital tubes in the system have independent terminals and the segment terminals are connected together. At the same time, the signals at the segment selection terminal are the same, and the displayed symbols should also be the same, but the bit selection terminal can control which LED digital tube emits light. For example: Taking the common cathode LED digital tube as an example, the bit selection and segment selection terminals are turned on when they are "1" and turned off when they are "0". The common cathode digital tube emits light when it is "1" and does not light up when it is "0".
…… //52 series microcontroller header file
sbitduan=P2^1, wei=P2^0; //Declare the latch end of the segment selection end and bit selection end latch
voidmain()
{wei=1;//Open bit selection
P0=0xFE;//Send signal 11111110B, even if the first LED digital tube emits light
wei=0; //Close bit selection
duan=1;//Open segment selection terminal
P0=0x5bH;//Send signal 01101101B, which means the LED digital tube displays the number "5"
duan=0;//Close segment selection}
(2) Dynamic display of LED digital tube
The dynamic display of LED digital tubes is also called the dynamic scanning display of LED digital tubes. It uses the afterglow of luminous tubes and the persistence of human vision to make people feel as if all digital tubes are displaying at the same time, but in fact there is only one digital tube at a certain moment. The data is displayed and the display time is short, generally between 1~10MS. For dynamic display of LED digital tubes, the CPU needs to scan and refresh the display regularly. It is generally suitable for occasions with a large number of display digits. It occupies few ports and has a relatively simple circuit design, but the editing is more complicated.
Previous article:Detailed explanation of multi-digit LED display hardware circuit design
Next article:Electronic clock and alarm clock control system based on single chip DS1302
- Popular Resources
- Popular amplifiers
- Detailed explanation of big data technology system: principles, architecture and practice (Dong Xicheng)
- Multi-port and shared memory architecture for high-performance ADAS SoCs
- Machine Learning: Architecture in the Age of Artificial Intelligence
- Research and design of electric vehicle drive motor ECU control software based on AUTOSAR
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
- [Fudan Micro FM33LG0 Series Development Board Evaluation] Development Board Hardware Evaluation, CMSIS-DAP Download Test
- What is carrier bandwidth in wireless communications?
- Participate to get gifts | Welcome to Tektronix High Speed Serial Knowledge Planet
- 【Fudan Micro FM33LC046N】A breathtaking clock
- What happened to ZTE? I saw an article and shared it with everyone
- [Gizwits Gokit 3 Review] + Late Unboxing Review
- SHT31 review + sharing an mdk5 engineering code file
- TMS320F280049C Learning-GPIO
- Do you have any suggestions for long-term sitting? Do you have any recommendations for long-term sitting tools?
- Embedded RK3399/RK3568 PCIE interface M2 solid state drive debugging