?? 1.lst
字號(hào):
C51 COMPILER V8.02 1 08/23/2009 09:27:02 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE 1
OBJECT MODULE PLACED IN 1.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 1.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include <c8051f020.h>
2 #include<intrins.h>
3
4 #define uint unsigned int
5 #define uchar unsigned char
6
7
8 #define x1 0x80
9 #define x2 0x88
10 #define y 0x80
11 #define comm 0
12 #define dat 1
13
14 sbit cs = P3^3;
15 sbit std = P3^6;
16 sbit sclk = P3^2;
17 sbit rst=P3^5;
18
19
20 void delay(uchar time)
21 {
22 1 while(time--);
23 1 }
24
25
26
27 void wr_lcd (uchar dat_comm,uchar content)
28 {
29 1 uchar a,i,j;
30 1 delay (50);
31 1 a=content;
32 1 cs=1;
33 1 sclk=0;
34 1 _nop_();
35 1 _nop_();
36 1 _nop_();
37 1 _nop_();
38 1 _nop_();
39 1 _nop_();
40 1 _nop_();
41 1 _nop_(); //8
42 1 _nop_(); //9
43 1 _nop_();
44 1 _nop_();
45 1 _nop_();//12
46 1 _nop_();
47 1 _nop_();//14
48 1 std=1;
49 1 for(i=0;i<5;i++)
50 1 {
51 2 sclk=1;
52 2 _nop_();
53 2 _nop_();
54 2 _nop_();
55 2 _nop_();
C51 COMPILER V8.02 1 08/23/2009 09:27:02 PAGE 2
56 2 _nop_();
57 2 _nop_();
58 2 _nop_();
59 2 _nop_(); //8
60 2 _nop_(); //9
61 2 _nop_();
62 2 _nop_();
63 2 _nop_();//12
64 2 _nop_();
65 2 _nop_();//14
66 2 sclk=0;
67 2 _nop_();
68 2 _nop_();
69 2 _nop_();
70 2 _nop_();
71 2 _nop_();
72 2 _nop_();
73 2 _nop_();
74 2 _nop_(); //8
75 2 _nop_(); //9
76 2 _nop_();
77 2 _nop_();
78 2 _nop_();//12
79 2 _nop_();
80 2 _nop_();//14
81 2 }
82 1 std=0;
83 1 sclk=1;
84 1 _nop_();
85 1 _nop_();
86 1 _nop_();
87 1 _nop_();
88 1 _nop_();
89 1 _nop_();
90 1 _nop_();
91 1 _nop_(); //8
92 1 _nop_(); //9
93 1 _nop_();
94 1 _nop_();
95 1 _nop_();//12
96 1 _nop_();
97 1 _nop_();//14
98 1 sclk=0;
99 1 _nop_();
100 1 _nop_();
101 1 _nop_();
102 1 _nop_();
103 1 _nop_();
104 1 _nop_();
105 1 _nop_();
106 1 _nop_(); //8
107 1 _nop_(); //9
108 1 _nop_();
109 1 _nop_();
110 1 _nop_();//12
111 1 _nop_();
112 1 _nop_();//14
113 1 if(dat_comm)
114 1 std=1; //data
115 1 else
116 1 std=0; //command
117 1 sclk=1;
C51 COMPILER V8.02 1 08/23/2009 09:27:02 PAGE 3
118 1 _nop_();
119 1 _nop_();
120 1 _nop_();
121 1 _nop_();
122 1 _nop_();
123 1 _nop_();
124 1 _nop_();
125 1 _nop_(); //8
126 1 _nop_();// 9
127 1 _nop_();
128 1 _nop_();
129 1 _nop_();//12
130 1 _nop_();
131 1 _nop_(); //14
132 1 sclk=0;
133 1 _nop_();
134 1 _nop_();
135 1 _nop_();
136 1 _nop_();
137 1 _nop_();
138 1 _nop_();
139 1 _nop_();
140 1 _nop_(); //8
141 1 _nop_(); //9
142 1 _nop_();
143 1 _nop_();
144 1 _nop_();//12
145 1 _nop_();
146 1 _nop_();//14
147 1 std=0;
148 1 sclk=1;
149 1 _nop_();
150 1 _nop_();
151 1 _nop_();
152 1 _nop_();
153 1 _nop_();
154 1 _nop_();
155 1 _nop_();
156 1 _nop_(); //8
157 1 _nop_(); //9
158 1 _nop_();
159 1 _nop_();
160 1 _nop_(); //12
161 1 _nop_();
162 1 _nop_(); //14
163 1 sclk=0;
164 1 _nop_();
165 1 _nop_();
166 1 _nop_();
167 1 _nop_();
168 1 _nop_();
169 1 _nop_();
170 1 _nop_();
171 1 _nop_(); //8
172 1 _nop_(); //9
173 1 _nop_();
174 1 _nop_();
175 1 _nop_(); //12
176 1 _nop_();
177 1 _nop_();//14
178 1 for(j=0;j<2;j++)
179 1 {
C51 COMPILER V8.02 1 08/23/2009 09:27:02 PAGE 4
180 2 for(i=0;i<4;i++)
181 2 {
182 3 a=a<<1;
183 3 std=CY;
184 3 sclk=1;
185 3 _nop_();
186 3 _nop_();
187 3 _nop_();
188 3 _nop_();
189 3 _nop_();
190 3 _nop_();
191 3 _nop_();
192 3 _nop_(); //8
193 3 _nop_();// 9
194 3 _nop_();
195 3 _nop_();
196 3 _nop_(); //12
197 3 _nop_();
198 3 _nop_(); //14
199 3 sclk=0;
200 3 _nop_();
201 3 _nop_();
202 3 _nop_();
203 3 _nop_();
204 3 _nop_();
205 3 _nop_();
206 3 _nop_();
207 3 _nop_(); //8
208 3 _nop_(); //9
209 3 _nop_();
210 3 _nop_();
211 3 _nop_();//12
212 3 _nop_();
213 3 _nop_();//14
214 3 }
215 2 std=0;
216 2 for(i=0;i<4;i++)
217 2 {
218 3 sclk=1;
219 3 _nop_();
220 3 _nop_();
221 3 _nop_();
222 3 _nop_();
223 3 _nop_();
224 3 _nop_();
225 3 _nop_();
226 3 _nop_(); //8
227 3 _nop_(); //9
228 3 _nop_();
229 3 _nop_();
230 3 _nop_(); //12
231 3 _nop_();
232 3 _nop_(); //14
233 3 sclk=0;
234 3 _nop_();
235 3 _nop_();
236 3 _nop_();
237 3 _nop_();
238 3 _nop_();
239 3 _nop_();
240 3 _nop_();
241 3 _nop_(); //8
C51 COMPILER V8.02 1 08/23/2009 09:27:02 PAGE 5
242 3 _nop_(); //9
243 3 _nop_();
244 3 _nop_();
245 3 _nop_();//12
246 3 _nop_();
247 3 _nop_();//14
248 3
249 3 }
250 2 }
251 1 }
252
253 void clrram (void)
254 {
255 1 wr_lcd (comm,0x30);
256 1 wr_lcd (comm,0x01);
257 1 delay (180);
258 1 }
259
260
261
262 void Init_lcd(void)//液晶初始化
263 {
264 1 wr_lcd (comm,0x30); /*30---基本指令動(dòng)作*/
265 1 wr_lcd (comm,0x01); /*清屏,地址指針指向00H*/
266 1 delay (100);
267 1 wr_lcd (comm,0x06); /*光標(biāo)的移動(dòng)方向*/
268 1 wr_lcd (comm,0x0b); /*開顯示,關(guān)游標(biāo)*/
269 1 }
270
271
272 void shuzi(uchar m)
273 {
274 1 uchar i,j;
275 1 wr_lcd(comm,0x30);
276 1 wr_lcd(comm,0x80);
277 1 j=0;
278 1 for(i=1;i<2;i++)
279 1 {
280 2 wr_lcd(dat,0x30|m);
281 2
282 2 //wr_lcd(dat,0x30|n);
283 2 //wr_lcd(dat,0x2e);
284 2 //wr_lcd(dat,0x30|g);
285 2 //wr_lcd(dat,0x30|h);
286 2
287 2 }
288 1 }
289
290
291 void Init_SYSCLK(void)
292 {
293 1 uint i;
294 1 OSCXCN = 0X67;//開始外部22.1184M晶振
295 1 //OSCXCN=0X75;
296 1 for(i = 0;i < 256;i++); //等待外部起振
297 1 while(!(OSCXCN & 0X80)); //查詢標(biāo)志位
298 1 //OSCICN = 0X88;//用外部晶振,并使能始終丟
299 1 OSCICN=0x0c;
300 1 // OSCICN=0X15;
301 1 /*
302 1 int n = 0;
303 1 OSCXCN = 0x67;
C51 COMPILER V8.02 1 08/23/2009 09:27:02 PAGE 6
304 1 for (n = 0; n < 255; n++) ;
305 1 while ( (OSCXCN & 0x80) == 0 );
306 1 OSCICN = 0x0c; */
307 1 }
308
309
310
311 void Init_PORT(void)
312 {
313 1 XBR2=0X40;
314 1 P3MDOUT=0XFF;
315 1
316 1 }
317
318
319 void main(void)
320 {
321 1 //Init_SYSCLK();
322 1 Init_PORT();
323 1 Init_lcd();
324 1
325 1 while(1)
326 1 {
327 2 shuzi(1);
328 2 //wr_lcd(comm,0x30);
329 2 //wr_lcd(comm,0x80);
330 2 //wr_lcd(dat,0x31);
331 2
332 2
333 2 }
334 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 396 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 1
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -