1.lst
来自「c8051f020模块.rar」· LST 代码 · 共 532 行 · 第 1/2 页
LST
532 行
250 1 //_nop_();
251 1 //_nop_(); //12
252 1 //_nop_();
253 1 //_nop_(); //14
254 1 sclk=0;
255 1 _nop_();
256 1 _nop_();
257 1 _nop_();
258 1 _nop_();
259 1 _nop_();
260 1 _nop_();
261 1 _nop_();
262 1 _nop_();
263 1 _nop_();
264 1 _nop_();
265 1 _nop_();
266 1 _nop_();
267 1 _nop_();
268 1 _nop_();
269 1 _nop_();
270 1 _nop_();
271 1 _nop_(); //17
272 1 _nop_();
273 1 _nop_(); //19
274 1 _nop_();
275 1 _nop_(); //21
276 1 _nop_();//22
277 1 _nop_();
278 1 _nop_();// 24
279 1 _nop_();
280 1 _nop_();
281 1 _nop_();
282 1 _nop_();//28
283 1 _nop_();
284 1 _nop_();
285 1 _nop_();
286 1 _nop_();
287 1 _nop_();
288 1 _nop_();
289 1 _nop_();
290 1 //_nop_();//36
291 1 //_nop_();
292 1 for(j=0;j<2;j++)
293 1 {
294 2 for(i=0;i<4;i++)
295 2 {
296 3 a=a<<1;
297 3 std=CY;
298 3 sclk=1;
299 3 _nop_();
300 3 _nop_();
301 3 _nop_();
302 3 _nop_();
303 3 _nop_();
C51 COMPILER V8.02 1 08/22/2009 22:43:58 PAGE 6
304 3 _nop_();
305 3 _nop_();
306 3 _nop_(); //8
307 3 _nop_();// 9
308 3 _nop_();
309 3 //_nop_();
310 3 //_nop_(); //12
311 3 //_nop_();
312 3 // _nop_(); //14
313 3 sclk=0;
314 3 _nop_();
315 3 _nop_();
316 3 _nop_();
317 3 _nop_();
318 3 _nop_();
319 3 _nop_();
320 3 _nop_();
321 3 _nop_();
322 3 _nop_();
323 3 _nop_();
324 3 _nop_();
325 3 _nop_();
326 3 _nop_();
327 3 _nop_();
328 3 _nop_();
329 3 _nop_();
330 3 _nop_();//17
331 3 _nop_();
332 3 _nop_();//19
333 3 _nop_();
334 3 _nop_();//21
335 3 _nop_(); //22
336 3 _nop_();
337 3 _nop_();// 24
338 3 _nop_();
339 3 _nop_();
340 3 _nop_();
341 3 _nop_();//28
342 3 _nop_();
343 3 _nop_();
344 3 _nop_();
345 3 _nop_();
346 3 _nop_();
347 3 _nop_();
348 3 _nop_();
349 3 //_nop_();//36
350 3 //_nop_();
351 3 }
352 2 std=0;
353 2 for(i=0;i<4;i++)
354 2 {
355 3 sclk=1;
356 3 _nop_();
357 3 _nop_();
358 3 _nop_();
359 3 _nop_();
360 3 _nop_();
361 3 _nop_();
362 3 _nop_();
363 3 _nop_(); //8
364 3 _nop_(); //9
365 3 _nop_();
C51 COMPILER V8.02 1 08/22/2009 22:43:58 PAGE 7
366 3 //_nop_();
367 3 // _nop_(); //12
368 3 //_nop_();
369 3 //_nop_(); //14
370 3 sclk=0;
371 3 _nop_();
372 3 _nop_();
373 3 _nop_();
374 3 _nop_();
375 3 _nop_();
376 3 _nop_();
377 3 _nop_();
378 3 _nop_();
379 3 _nop_();
380 3 _nop_();
381 3 _nop_();
382 3 _nop_();
383 3 _nop_();
384 3 _nop_();
385 3 _nop_();
386 3 _nop_();
387 3 _nop_(); //17
388 3 _nop_();
389 3 _nop_();//19
390 3 _nop_();
391 3 _nop_();//21
392 3 _nop_();//22
393 3 _nop_();
394 3 _nop_();// 24
395 3 _nop_();
396 3 _nop_();
397 3 _nop_();
398 3 _nop_();//28
399 3 _nop_();
400 3 _nop_();
401 3 _nop_();
402 3 _nop_();
403 3 _nop_();
404 3 _nop_();
405 3 _nop_();
406 3 //_nop_();//36
407 3 //_nop_();
408 3 }
409 2 }
410 1 }
411
412 void clrram (void)
413 {
414 1 wr_lcd (comm,0x30);
415 1 wr_lcd (comm,0x01);
416 1 delay (180);
417 1 }
418
419
420
421 void Init_lcd(void)//液晶初始化
422 {
423 1 wr_lcd (comm,0x30); /*30---基本指令动作*/
424 1 wr_lcd (comm,0x01); /*清屏,地址指针指向00H*/
425 1 delay (100);
426 1 wr_lcd (comm,0x06); /*光标的移动方向*/
427 1 wr_lcd (comm,0x0b); /*开显示,关游标*/
C51 COMPILER V8.02 1 08/22/2009 22:43:58 PAGE 8
428 1 }
429
430
431 void shuzi(uchar m)
432 {
433 1 uchar i,j;
434 1 wr_lcd(comm,0x30);
435 1 wr_lcd(comm,0x80);
436 1 j=0;
437 1 for(i=1;i<2;i++)
438 1 {
439 2 wr_lcd(dat,0x30|m);
440 2
441 2 //wr_lcd(dat,0x30|n);
442 2 //wr_lcd(dat,0x2e);
443 2 //wr_lcd(dat,0x30|g);
444 2 //wr_lcd(dat,0x30|h);
445 2
446 2 }
447 1 }
448
449
450 void Init_SYSCLK(void)
451 {
452 1 uint i;
453 1 OSCXCN = 0X67;//开始外部22.1184M晶振
454 1 //OSCXCN=0X75;
455 1 for(i = 0;i < 256;i++); //等待外部起振
456 1 while(!(OSCXCN & 0X80)); //查询标志位
457 1 OSCICN = 0X88;//用外部晶振,并使能始终丢
458 1 //OSCICN=0x0c;
459 1 // OSCICN=0X15;
460 1 /*
461 1 int n = 0;
462 1 OSCXCN = 0x67;
463 1 for (n = 0; n < 255; n++) ;
464 1 while ( (OSCXCN & 0x80) == 0 );
465 1 OSCICN = 0x0c; */
466 1 }
467
468
469
470 void Init_PORT(void)
471 {
472 1 XBR2=0X40;
473 1 P3MDOUT=0XFF;
474 1
475 1 }
476
477
478 void main(void)
479 {
480 1 Init_SYSCLK();
481 1 Init_PORT();
482 1 Init_lcd();
483 1
484 1 while(1)
485 1 {
486 2 shuzi(1);
487 2 wr_lcd(comm,0x30);
488 2 wr_lcd(comm,0x80);
489 2 wr_lcd(dat,0x31);
C51 COMPILER V8.02 1 08/22/2009 22:43:58 PAGE 9
490 2
491 2 }
492 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 544 ----
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)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?