Interface Design of Liquid Crystal Display in Single Chip Microcomputer System

Publisher:RadiantEyesLatest update time:2013-11-07 Source: dzsc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Interface Design of Liquid Crystal Display in Single Chip Microcomputer System

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

Latest Microcontroller Articles
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号