📄 12864.lst
字号:
C51 COMPILER V7.09 12864 04/06/2007 17:49:13 PAGE 1
C51 COMPILER V7.09, COMPILATION OF MODULE 12864
OBJECT MODULE PLACED IN 12864.OBJ
COMPILER INVOKED BY: f:\Keil\C51\BIN\C51.EXE 12864.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include<reg52.h>
2 #include <intrins.h>
3
4 #define U1 bit
5 #define U8 unsigned char
6 #define PU8 unsigned char pdata
7 #define U16 unsigned int
8 #define VU8 volatile unsigned char
9 #define VU16 volatile unsigned int
10
11 #ifndef NULL
12 #define NULL ((void *) 0L)
13 #endif
14
15 #ifndef BIT
16 #define BIT(B) (1 << (B))
17 #endif
18
19 #define LCDPORT P1
20 sbit CAS1 = P3^5;
21 sbit CAS2 = P2^7;
22 sbit RS = P3^4;
23 sbit RW = P3^3;
24 sbit E = P3^2;
25 sbit LED = P2^0;
26
27 //void Delay(U8 time)
28 //{
29 //U8 i;
30
31 // while(time--) for(i =255; i > 0; i--);
32 //}
33
34 U8 AskBusy(void)
35 {
36 1 U8 temp;
37 1
38 1 RS = 0; RW = 1;
39 1 LCDPORT = 0xff; E = 1;
40 1 temp = LCDPORT; E = 0;
41 1 return (temp & 0x80);
42 1 }
43
44
45 void CmdPos(U8 cmd, U8 num)
46 {
47 1
48 1 if(!num) {CAS1 = 1; CAS2 = 0;}
49 1 else {CAS1 = 0; CAS2 = 1;}
50 1 while(AskBusy());
51 1 RS = 0; RW = 0;
52 1 E = 1;
53 1 LCDPORT = cmd;
54 1 E = 0;
55 1 }
C51 COMPILER V7.09 12864 04/06/2007 17:49:13 PAGE 2
56
57 void TansData(U8 ch)
58 {
59 1 while(AskBusy());
60 1 RS = 1; RW = 0;
61 1 E = 1;
62 1 LCDPORT = ch;
63 1 E = 0;
64 1 }
65
66 void TansCmd(U8 cmd) {CmdPos(cmd, 0); CmdPos(cmd, 1);}
67 void InitLCD(void) {CAS1 = 0; CAS2 = 0; E = 0; TansCmd(0x3e);}
68 void OpenLcd(void) {TansCmd(0xc0); TansCmd(0x3f);}
69
70 void CleanLCD(void)
71 {
72 1 U8 i,j;
73 1
74 1 for(j = 0; j < 8; j++)
75 1 {
76 2 TansCmd(0xb8 | j); TansCmd(0x40);
77 2 CAS1 = 1; CAS2 = 0;
78 2 for(i = 0; i < 64; i++) TansData(0);
79 2 CAS1 = 0; CAS2 = 1;
80 2 for(i = 0; i < 64; i++) TansData(0);
81 2 }
82 1 }
83
84 void LoadPic(void)
85 {
86 1 PU8 i, j;
87 1 U8 code *pc = 0x400;
88 1
89 1
90 1 for(j = 0; j < 8; j++)
91 1 {
92 2 TansCmd(0xb8 | j); TansCmd(0x40);
93 2 CAS1 = 1; CAS2 = 0;
94 2 for(i = 0; i < 64; i++) {TansData(*pc); pc++;}
95 2 CAS1 = 0; CAS2 = 1;
96 2 for(i = 0; i < 64; i++) {TansData(*pc); pc++;}
97 2 }
98 1 }
99
100 void main(void)
101 {
102 1
103 1 InitLCD();
104 1 CleanLCD();
105 1 LoadPic();
106 1 OpenLcd();
107 1 LED = 0;
108 1 while(1);
109 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 247 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- 2
DATA SIZE = ---- ----
C51 COMPILER V7.09 12864 04/06/2007 17:49:13 PAGE 3
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 + -