📄 lcd.lst
字号:
C51 COMPILER V7.06 LCD 07/30/2008 10:25:19 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE LCD
OBJECT MODULE PLACED IN lcd.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE lcd.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1
2
3 #include <reg52.h>
4 #include <absacc.h>
5 #include <intrins.h>
6
7 #define uchar unsigned char
8 #define uint unsigned int
9
10 #define PA8255 XBYTE[0x3ffc]
11 #define PB8255 XBYTE[0x3ffd]
12 #define PC8255 XBYTE[0x3ffe]
13 #define COM8255 XBYTE[0x3fff]
14
15 #define LcdWComm XBYTE[0x5ffc]
16 #define LcdRComm XBYTE[0x5ffd]
17 #define LcdWData XBYTE[0x5ffe]
18 #define LcdRData XBYTE[0x5fff]
19
20 sbit cs138=P1^6;
21 uchar key;
22 void LcdInit(void);
23 void LcdWRComm(uchar);
24 void LcdWRData(uchar);
25 void delay(uchar);
26 void timer11(void);
27
28
29 uchar times=0 , temp0='2',temp1='0',temp2='0',temp3='8',temp4='0',temp5='7',temp6='2',
30 temp7='8',temp8='0',temp9='0',tempA='0',tempB='0',tempC='0',tempD='0';
31
32
33
34
35
36
37 void main(void)
38
39
40 {
41 1 TMOD=0x01;
42 1 TH0=0x4c;
43 1 TL0=0x00;
44 1 IE=0x82;
45 1 TR0=1;
46 1 cs138=0;
47 1
48 1 LcdInit();
49 1
50 1 while(1)
51 1
52 1 {
53 2
54 2 LcdWRComm(0x82 );
55 2 LcdWRData(0xbb);LcdWRData(0xb6);LcdWRData(0xd3);LcdWRData(0xad);
C51 COMPILER V7.06 LCD 07/30/2008 10:25:19 PAGE 2
56 2 LcdWRData(0xca);LcdWRData(0xb9);LcdWRData(0xd3);LcdWRData(0xc3);
57 2 LcdWRComm(0x91 );
58 2 LcdWRData(0xbb);LcdWRData(0xe3);LcdWRData(0xb4);LcdWRData(0xb4);
59 2 LcdWRData(0xd6);LcdWRData(0xc7);LcdWRData(0xc4);LcdWRData(0xdc);
60 2 LcdWRData(0xcf);LcdWRData(0xb5);LcdWRData(0xcd);LcdWRData(0xb3);
61 2 LcdWRComm(0x89 );
62 2 LcdWRData(temp8);LcdWRData(temp9);LcdWRData(0xa1);LcdWRData(0xc3);
63 2 LcdWRData(tempA);LcdWRData(tempB);LcdWRData(0xa1);LcdWRData(0xc3);
64 2 LcdWRData(tempC);LcdWRData(tempD);
65 2 // LcdWRComm(0x9a );
66 2 // LcdWRData(0xba);LcdWRData(0xee);LcdWRData(0xc9);LcdWRData(0xad);
67 2 // LcdWRData(0xbc);LcdWRData(0xd3);LcdWRData(0xd3);LcdWRData(0xcd);
68 2 }
69 1 }
70 void timer11(void) interrupt 1
71
72 { TH0=0x4c;
73 1 TL0=0x00;
74 1 times++;
75 1 if(times==20)
76 1 {times=0;tempD++;
77 2 if(tempD=='9'+1) //--------------------->>
78 2 {tempD='0';tempC++;
79 3 if(tempC=='5'+1) //--------------------->>
80 3 {tempC='0';tempB++;
81 4 if(tempB=='9'+1) //--------------------->>
82 4 {tempB='0';tempA++;
83 5 if(tempA=='5'+1)//--------------------->>
84 5 {tempA='0';temp9++;
85 6 if(temp9=='9'+1)//--------------------->>
86 6 {temp9='0';temp8++;
87 7 if(temp8=='3'+1)//--------------------->>
88 7 {temp8='0';//temp8++;
89 8
90 8 }
91 7 }
92 6 }
93 5
94 5
95 5 }
96 4
97 4 }
98 3 }
99 2 }
100 1
101 1 }
102
103
104
105
106
107 //******************************************************
108
109
110
111 void LcdInit(void)
112
113 {
114 1 LcdWRComm(0x30);LcdWRComm(0x0c);
115 1 LcdWRComm(0x01);LcdWRComm(0x06);
116 1 //LcdWRComm(0x40);
117 1
C51 COMPILER V7.06 LCD 07/30/2008 10:25:19 PAGE 3
118 1 }
119
120 void LcdWRComm(uchar x)
121 { LcdWComm=x;delay(2);
122 1 }
123
124 void LcdWRData(uchar x)
125 { LcdWData=x;delay(2);
126 1 }
127
128 void delay(uchar j)
129 {uchar k;
130 1 while(j--)
131 1 for(k=0;k<125;k++);
132 1 }
133
134
135
136
137
138
139
140
141
142
143
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 332 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 16 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -