loading

Focus on R&D of LED lighting,provide competitive systematic lighting solutions

Application of 74LS164 in LED Display Circuit of 2051 Single Chip Microcomputer

74LS164 introduction74LS164 and 74lst164 are high-speed silicon gate CMOS devices, which are compatible with the pins of low-power Schottky TTL (LSTTL) devices.74HC164 and 74hct164 are 8-bit edge triggered shift registers, which input data serially and then output in parallel. Data is input serially through one of two input terminals (DSA or DSB); Either input can be used as a high-level enable to control the data input of the other input. The two input terminals are either connected together, or the unused input terminals are connected to a high level. Be sure not to hang in the air.

Application of 74LS164 in LED Display Circuit of 2051 Single Chip Microcomputer 1

Each time the clock (CP) changes from low to high, the data moves to the right by one bit and is input to Q0. Q0 is the logical sum of the two data inputs (DSA and DSB), which will maintain a length of setup time before the rising clock edge.A low level on the main reset (MR) input will invalidate all other inputs, clear the register asynchronously, and force all outputs to low level.Function diagram

AT89C2051 is a high-performance low-cost single chip microcomputer, but because of its few pins, it brings some difficulties to the system design, especially the design of LED display interface circuit. This problem is satisfactorily solved by using serial in parallel out shift register 74LS164. The composition principle and software of the interface circuit are introduced in detail. The actual operation shows that the display circuit can be successfully applied to the intelligent instrument with AT89C2051 single chip microcomputer as the core, and the LED display is clear and stable, and the luminous brightness can be adjusted online.

AT89 series single chip microcomputer [1] is a new 8-bit CMOS microcomputer with high performance, low price, low voltage and low power consumption introduced by ATMEL company in the United States in recent years. Its remarkable advantages are: it contains flash memory, which can modify the program at will in the process of system development. Even after wrong programming, it can still be reprogrammed, so there is no waste and greatly shortens the development cycle of the program; At the same time, it can effectively save data information in the working process of the system. The static clock mode is adopted to save electric energy, which is very beneficial to reduce the power consumption of portable products. Because it is composed of 8031 core, it is compatible with MCS251 series single chip microcomputer. For the majority of users familiar with MCS251 series, it is easy to use AT89 series single chip microcomputer to replace 51 series for system design.

AT89C2051 is a cheaper single chip microcomputer in AT89 series. As a core device of small measurement and control system or portable intelligent instruments, its performance price ratio is better than MCS251 series. The difference is that it has only 20 pins, much less than the standard 40, that is, fewer parallel I / O ports. How to use these few port lines to connect into a stable and reliable LED display circuit is the bottleneck problem to be solved by the application circuit with AT89C2051 single chip microcomputer as the core.In this paper, 74LS164 Series in parallel out shift register is used to solve the display interface circuit between 2051 and led.hardware circuit

Application of 74LS164 in LED Display Circuit of 2051 Single Chip Microcomputer 2

The remaining parallel I / O port lines in 2051 are less than 8, so the parallel output of data is impossible, but the serial output method can be considered. Figure 1 shows the 4-bit LED display interface circuit extended by the serial port.The circuit only uses three ports of 2051, and is equipped with four serial in and parallel out shift registers 74LS164 and one three terminal adjustable regulator lm317t. Pins Q0 Q7 of 74LS164 are 8-bit parallel output terminals; Pins a and B are serial inputs; Pin CL K is the clock pulse input terminal, which is shifted under the action of the rising edge of CL K pulse. When CL k = 0 and clear terminal m r = 1, 74LS164 maintains the original data state; When M r = 0, 74LS164 output is cleared.

The working process is as follows: the serial port of 2051 is set in the mode 0 shift register state, the serial data is sent by P3.0, and the shift clock is sent by P3.1. Under the action of the shift clock, the data of the serial port transmission buffer is moved into 74LS164 bit by bit. Four 74LS164 chips are extended in series into four 8-bit parallel output ports, which are respectively connected to the segment selection ends of four LED displays for static display. It should be pointed out that since 74LS164 has no parallel output control terminal, the state of its output terminal will change continuously in the process of serial input, resulting in dark brightness of fields that should not be displayed, affecting the display effect.

In the past, four latches or three state gates were added to the output of 74LS164, so that the change of the output of the shift register when the serial input data was not reflected on the LED. After the serial input, the latch or three state gate was opened to send the stable display data to the LED.

The uniqueness of the circuit in this paper is that only one three terminal adjustable regulator lm317t is adopted. Pins 3 and 2 of 317t are voltage input and output respectively, pin 1 of 317t is voltage adjustment end, and the output voltage of pin 2 changes with the voltage of pin 1. There is an NPN triode between pin 1 and the grounding resistance. Its base is controlled by the P1.7 port line. The P1.7 port line is high level during serial input. The saturated conduction of the triode makes pin 1 of 317t about 0.3 V, and the output voltage of pin 2 drops to 1.5 V, which is not enough to make the common anode led emit light. Therefore, the influence of serial input will not be reflected on the LED; After the serial input, make the P1.7 port line low, cut off the triode, and the output voltage of pin 2 will rise to 2.0 V due to the increase of pin 1 voltage, so as to make the LED light normally. Therefore, one three terminal adjustable regulator lm317t acts as four latches so that the LED display will not flash. Another advantage of this circuit is that the output voltage of pin 2 can be adjusted online through the adjustable potentiometer P1, so that the display brightness of LED can be adjusted evenly, and a large number of LED current limiting resistors are saved.

Software programmingThe above analysis shows that the shift register 74LS164 only works in series and out, and has no decoding function. Therefore, before writing the display driver, it is necessary to calculate the column and write the LED segment selection code corresponding to the circuit, then send it to the serial input of 164 through P3.0 port 2051, and then output it to the segment selection terminal of LED in parallel.

It should be pointed out that this circuit adopts tos28106bhk common anode LED display. According to the convenient connection of PCB printed circuit board, the connection between the 8 segment selection ends of LED and the parallel output port of 164, that is, the 8 segment selection lines do not follow the usual law, but the segments are arranged as 7, 6, 4, 2, 1, 9, 10 and 5 as shown in Figure 1, and the corresponding segment selection codes should also be recalculated, For example, the segment selection code of display character 0 is 11h, and the segment selection code of display character 1 is d7h, etc.

In addition, this stable static display mode also eliminates the dynamic scanning process of CPU, which is another feature of this circuit.A 4-digit LED display is designed in the circuit. Its functions are as follows: the first digit on the left is a hundred digit or flag digit, the second digit on the left is a ten digit, the third digit on the left is a single digit, and the fourth digit on the left is a tenth digit after the decimal point. Accordingly, a block diagram of the display subroutine shown in Fig. 2 is given.The list of displayed subroutines is as follows:

DISISETB P1. 7 ; Off displayMOV R0 # SBCD

MOV A @R0 ; Take out the number to displayADD A # 2DH ; Add offsetMOVC A @A PC ; Look up the table and take out the segment code

MOV SBUF A ; Send out displayDL1 JNB TI DL1 ; Output finished?CLR TI ; End, clear the interrupt flag

INC R0MOV A @R0ADD A # 21H

MOVC A @A PCANL A # OEFH ; One digit plus decimal pointMOV SBUF A

DL2 JNB TI DL2CLR TIINC R0

MOV A @R0ADD A # 13HMOVC A @A PC

MOV SBUF ADL3 JNB TI DL3CLR TI

MOV A # 0FFHMOV SBUF ADL4 JNB TI DL4

CLR TICLR P1. 7 ; HighlightRET

SEGTAB DB 11H 0D7H 32HDB 92H 0D4H 98HDB 18H 0D3H 10H 0D0H

The LED display interface circuit extended by the serial port has been successfully applied to the intelligent instruments with AT89C2051 single chip microcomputer as the core, such as single chip microcomputer humidity measuring instrument, single chip microcomputer temperature measuring instrument and so on. The field operation shows that the LED display is clear, stable and does not flicker. Especially in the field environment, such as different light intensity, the brightness of LED can be adjusted online to obtain the best effect of vision and power consumption.

GET IN TOUCH WITH Us
recommended articles
NEWS Application
Haochenlight is pleased to offer our new all-in-one solar street lighting system. All-in-one solar street lights integrate solar panels, LED light sources and batteries into a compact, reliable and extremely bright package. This street, area and parking lot lighting replacement system is a complete unit, making the product quick and easy to install and a reliable, cost-effective and efficient way to light your project. It is also a high-return investment method. Haochenlight's all-in-one solar street lights and parking lot lights offer adjustable timing control modes and human sensor modes via a single remote control. Time control modes include overnight sensor mode and morning mode. Just one simple setup; the controller automatically adjusts for each mode.
Many outdoor LED landscape lamps use LED street light source. Why should outdoor LED landscape lamps use this kind of light source? What are its advantages? Below, our outdoor LED landscape lamp manufacturer drill brand lighting receives the advantag...
In the application of LED street lamps, there is a problem of configuring lighting engineering according to the "power" index of lamps. However, if the overall lamp efficiency and utilization of LED lamp and sodium lamp are not correctly grasped, it ...
LED solar street lamps have various models and specifications in the market. It can well meet various needs of users, so that we can more clearly choose what type of LED solar street lamps to buy. Of course, if you don't know this type of products, y...
The efficacy of lawn lamp is its appearance and mild lighting effect, which increases the safety and beauty of greening landscape. In addition, it is also used as a beautiful landscape lawn lamp manufacturer's equipment on the grass in broad daylight...
Technical advantages of two body street lamp: 1. Cumbersome installation and disassembly: during the installation and disassembly of solar street lamp, there is no need to set up complex lines, just make a cement base and a battery pit, which can be ...
The components of rural solar street lamps are connected by lines and complete their work through current conduction. As we all know, line conduction will generate heat and lose energy. A large part of the country's electricity is consumed in long-di...
1. Shell material: Generally speaking, the thickness of the shell of the public model traffic signal lamp is relatively thin, within 140mm. The raw materials generally include pure PC material, ABS material, recycled material, miscellaneous material,...
Solar street lamp system can ensure normal operation in cloudy and rainy weather for more than 15 days! Its system is composed of LED light source (including drive), solar panel, battery (including battery incubator), solar street lamp controller, st...
Solar street lamp is a kind of road lamp that uses solar energy as the external power supply of street lamp, which can add light to the night life of urban residents.It can be said that it is equivalent to removing half of the power consumption and h...
no data
Beijing Haochen Ruixiang Technology Co., Ltd.
Beijing Haochen Ruixiang Technology Co., Ltd. was founded in 2013, the registered capital of 58 million yuan, is a professional LED lighting products research and development, production, sales in one of the lighting energy-saving technology company
Contact Us
    Viviansolarled@haochenlight.com
    +86 13621090567
ADD: 
Beijing Headquarters: Room 320, Building 2, Fangheng Apartment, No. 15 Fangzhuang South Road, Fengtai District, Beijing
Factory address
Inside the Haochen Lighting Courtyard opposite the archway on Jinsha Shabian Avenue, Danzao Town, Nanhai District, Foshan City, Guangdong Province
Copyright © 2024  www.haochenlight.com   
Customer service
detect