introduction
Liquid crystal display (LCD) has many advantages that other displays cannot match, such as low display power consumption, small size, light weight, and ultra-thinness, and is widely used in low-power single-chip systems. LCD can be divided into segment LCD, character LCD, and dot matrix LCD. Among them, segment LCD and character LCD can only be used for the display of characters and numbers. This article introduces segment LCD EDS806 and EDS812, and gives its interface with the single-chip computer and programming method.
In the display data diagram, after being processed by the program in the single-chip microcomputer (one of the 51 series can be selected, omitted in the diagram), the output display signal is sent to the P1 port (4 bits of data, 4 bits of selection signal). 4 bits of the data are sent to the MC14543 (BCD -- latch/7-segment decoding/driver), and after decoding, the output terminals a, b, c, d, e, f, and g of the MC14543 are connected to the 8-bit EDS806 and the 3-bit EDS812 respectively. Each digital bit requires an MC14543.
The 4-bit selection signal is sent to the CD4514 decoder (4-bit latch / 4-16 line decoder), which selects the MC14543 chip that receives the data and the decimal point for floating display. (8-bit EDS806 can be displayed floatingly)
In order to enable EDS806 to be displayed floatingly, MC14174B and CD4070 are used to control the decimal point.
program
When using this display interface diagram to display general data such as temperature, humidity, pressure, flow, etc., the procedure is as follows:
ORG 0085H
L0085: ORL P1,#0FFH ;P1 port is set to 1, 4FH~40H is the data to be displayed (high~low)
MOV A,4FH ;Is the highest bit 0
NOP
NOP
MOV A,4FH
ANL A,#0ffH
JZ L009E ;If it is 0, transfer
MOV DPTR, #0F9BH ;The first segment of display data (the data is the largest at this time)
MOV 2FH,#0a0h ;Send decimal point data to 2FH
LJMP L00DD
L009E: MOV A,4EH ;Is the second highest bit 0
NOP
NOP
MOV A,4EH
ANL A,#0FFH
JZ L00B1 ;If it is 0, transfer
MOV DPTR, #0155H ;The second segment of display data
MOV 2FH, #21H ;Send decimal point data to 2FH
LJMP L00DD
L00B1: MOV A,4DH
NOP
NOP
MOV A,4DH
ANL A,#0FFH
JZ L00C4 ; transfer to 0
MOV DPTR, #0139H ; the third segment displays data
MOV 2FH, #22H ; send decimal point data to 2FH
LJMP L00DD
L00C4: MOV A,4CH
NOP
NOP
MOV A,4CH
ANL A,#0FFH
JZ L00D7 ; transfer to 0
MOV DPTR,#011DH ; the fourth segment displays data
MOV 2FH,#24H ; send decimal point data to 2FH
LJMP L00DD
L00D7: MOV DPTR, #0171H; fifth segment display data
MOV 2FH, #28H; send decimal point data to 2FH
L00DD: MOV B, #0DH; Display the number of data in the data
MOV A,2FH
ANL A,#0FH
MOV 2DH,A
MOV A,2FH
ANL A,#0F0H
SWAP A
MOV 2FH,A
CLR A
L00EE: MOVC A,@A+DPTR ;Get the data of the corresponding segment for display
MOV R0,A
MOV A,@R0
ORL A,#0F0H
ANL P1,A
NOP
NOP
NOP
NOP
NOP
ANL P1,A
CLR A
INC DPTR
MOVC A,@A+DPTR
ANL P1,A
NOP
NOP
NOP
NOP
ANL P1,A
ORL P1,#0F0H
ORL P1,#0FFH
CLR A
INC DPTR
DJNZ B,L00EE
END [page]
ORG 0F9BH; The following is the display data, floating five digits, and floating eight digits can be made similarly.
DB
4FH,0DFH,4EH,0CFH,4DH,9FH,4CH,8FH,4BH,7FH,
4AH,6FH,49H,5FH,48H,4FH
DB
47H,3FH,38H,2FH,37H,1FH,36H,0FH,2FH,0AFH,2DH, 0BFH, ORG 0155H
DB
4EH,0DFH,4DH,0CFH,4CH,9FH,4BH,8FH,4AH,7FH,
49H,6FH,48H,5FH,47H,4FH
DB
46H,3FH,38H,2FH,37H,1FH,36H,0FH,2FH,0AFH,2DH, 0BFH,ORG 0139H
DB
4DH,0DFH,4CH,0CFH,4BH,9FH,4AH,8FH,49H,7FH,
48H,6FH,47H,5FH,46H,4FH
DB
45H,3FH,38H,2FH,37H,1FH,36H,0FH,2FH,0AFH,2DH, 0BFH,ORG 011DH
DB
4CH,0DFH,4BH,0CFH,4AH,9FH,49H,8FH,48H,7FH,47H,
6FH,46H,5FH,45H,4FH
DB
44H,3FH,38H,2FH,37H,1FH,36H,0FH,2FH,0AFH,2DH, 0BFH,ORG 0171H
DB
4BH,0DFH,4AH,0CFH,49H,9FH,49H,8FH,47H,7FH,46H,
6FH,45H,5FH,44H,4FH
DB
43H,3FH,38H,2FH,37H,1FH,36H,0FH,2FH,0AFH,2DH, 0BFH
When using this display interface diagram for parameter setting, the current modified digit needs to be displayed in a flashing state. Use the interrupt method. The program is as follows:
L05E6: PUSH ACC ;Save the scene
PUSH PSW
MOV PSW,#08H
MOV TL1,#00H ;Set the timer
MOV TH1,#00H
MOV R1, #24H ;24H contains the current
position (11~0)
MOV R0,#25H ;Data unit
MOV R7,#0BH ;Display 8+3, a total of 11 digits
L05FE: MOV A,#00H
ORL A,#0F0H
ANL P1,A
CLR A
MOV A,#0BFH ;Do not display the decimal point
data of EDS812
ANL P1,A
ORL P1,#0F0H
MOV A,#00H
ORL A,#0F0H
ANL P1,A
ANL P1,A
CLR A
MOV A,#0AFH ;Do not display the decimal point data of EDS806A
ANL P1,A
ORL P1,#0F0H
CJNE R7,#24H, L0635 ;If it is not the current bit, go to
L0635, skip the flashing part
CPL 0BH ;Invert 0BH, whenever it is 1, the current bit should be displayed, otherwise it will be blanked
JNB 0BH, L0635
MOV A,#0FH
LJMP L0636
L0635: MOV A,@R0 ;Display digital bit
L0636: ANL A,#0FH
MOV P1,A
ORL A,#0F0H
MOV P1,A
INC R0
L0648: DJNZ R7,L05FE ;Have all bits been displayed?
POP PSW ;Restore the scene and return.
POP ACC
RETI
Summarize
This paper presents the hardware design and implementation of LCD display control in a low-power single-chip system. The software program is annotated in detail. The above circuit, as the system display front end developed by us, has been successfully applied in practice.
Previous article:High-sensitivity control system of stepping motor based on 87C196KC single-chip microcomputer
Next article:Energy-saving lighting control system based on single chip microcomputer
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- CodeBug Hands-on Learning 1 - Unboxing
- Please help me solve the problem of converting gerber files to PCB files
- HP laptop battery is swollen, where can I get a new one?
- pyRTOS(1): Introduction
- CircuitPython 5.0.0 Beta 5 released
- Problem with conditional execution with $value$plusargs
- An Engineer's Guide to EMI - Specification and Measurement
- C5000 compiles SUBC instruction to implement division
- Improvements and updates to the forum's "Invite Netizens" function
- Using Mao Zedong Thought to Improve the Efficiency of Counter-inspiration