📄 lcd12864.lst
字号:
C51 COMPILER V9.00 LCD12864 08/20/2011 21:38:09 PAGE 1
C51 COMPILER V9.00, COMPILATION OF MODULE LCD12864
OBJECT MODULE PLACED IN lcd12864.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE lcd12864.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include<reg52.h>
2 #include<intrins.h>
3 #define uchar unsigned char
4 #define uint unsigned int
5 sbit rs=P1^0;
6 sbit rw=P1^1;
7 sbit en=P1^2;
8 uchar code one[]="智天电子";
9 uchar code two[]="52与AVR 实验板";
10 uchar code three[]="单片机 C语言学习";
11 uchar code four[]="从零开始快速入门 ";
12 void delay(uint z)
13 {
14 1 uint x,y;
15 1 for(x=z;x>0;x--)
16 1 for(y=110;y>0;y--);
17 1 }
18 void write12864_command(uchar command)//写指令子函数
19 {
20 1 rs=0;
21 1 rw=0;
22 1 P2=command;
23 1 delay(2);
24 1 en=1;
25 1 delay(3);
26 1 en=0;
27 1 }
28 void write12864_data(uchar date)//写数据子函数
29 {
30 1 rs=1;
31 1 rw=0;
32 1 P2=date;
33 1 delay(2);
34 1 en=1;
35 1 delay(3);
36 1 en=0;
37 1 }
38 void init()
39 {
40 1 en=0;
41 1 rw=0;
42 1 write12864_command(0x38);
43 1 write12864_command(0x01);
44 1 write12864_command(0x0c);
45 1 write12864_command(0x06);
46 1 write12864_command(0x80);
47 1 }
48 void main()
49 { uchar i,ge,shi,bai,temp=0;
50 1 init();
51 1 write12864_command(0x80);
52 1 for(i=0;one[i]!='\0';i++)
53 1 {
54 2 write12864_data(one[i]);
55 2 delay(1);
C51 COMPILER V9.00 LCD12864 08/20/2011 21:38:09 PAGE 2
56 2 }
57 1 write12864_command(0x90);
58 1 for(i=0;two[i]!='\0';i++)
59 1 {
60 2 write12864_data(two[i]);
61 2 delay(1);
62 2 }
63 1 write12864_command(0x88);
64 1 for(i=0;three[i]!='\0';i++)
65 1 {
66 2 write12864_data(three[i]);
67 2 delay(1);
68 2 }
69 1 write12864_command(0x98);
70 1 for(i=0;four[i]!='\0';i++)
71 1 {
72 2 write12864_data(four[i]);
73 2 delay(1);
74 2 }
75 1 while(1)
76 1 {
77 2 bai=temp/100;
78 2 shi=temp%100/10;
79 2 ge=temp%10;
80 2 write12864_command(0x80+5);
81 2 write12864_data(0x30+bai);
82 2 write12864_data(0x30+shi);
83 2 write12864_data(0x30+ge);
84 2 temp++;
85 2 if(temp>200)
86 2 temp=0;
87 2 delay(800);
88 2 }
89 1
90 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 273 ----
CONSTANT SIZE = 59 ----
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -