📄 lcdp.lst
字号:
C51 COMPILER V7.20 LCDP 06/20/2005 16:55:58 PAGE 1
C51 COMPILER V7.20, COMPILATION OF MODULE LCDP
OBJECT MODULE PLACED IN LCDP.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE LCDP.c BROWSE DEBUG OBJECTEXTEND
line level source
1 /*--------------------------------
2 lcd display 16x2 chinese
3 driver chip st7920
4 2002.12.28
5 ----------------------------*/
6 #include <stdlib.h>
7 #include <ctype.h>
8 #include <intrins.h>
9 #include <AT89X52.H>
10 #include <absacc.h>
11 #include "charger.h"
12 //---------------------------------------
13 //define signal connection
14 //---------------------------------------
15 #define LCDRS T0
16 #define LCDRW P1_7
17 #define ENABLE T1
18 #define DATABUS XBYTE[0x6000]
19
20 extern void delay(unsigned int i);
21 static void isBusy(void);
22
23
24 //-------------------------------
25 //LCD display char,write data to LCD ram
26
27 void WD_LCD(unsigned char ch)
28 {
29 1 isBusy();
30 1 LCDRS=1;
31 1 _nop_();
32 1 _nop_();
33 1 _nop_();
34 1 LCDRW=0;
35 1 _nop_();
36 1 _nop_();
37 1 _nop_();
38 1 DATABUS=ch;
39 1 _nop_();
40 1 _nop_();
41 1 _nop_();
42 1 _nop_();
43 1 _nop_();
44 1 _nop_();
45 1 ENABLE=1;
46 1 _nop_();
47 1 _nop_();
48 1 _nop_();
49 1 _nop_();
50 1 _nop_();
51 1 _nop_();
52 1 ENABLE=0;
53 1 _nop_();
54 1 _nop_();
55 1 }
C51 COMPILER V7.20 LCDP 06/20/2005 16:55:58 PAGE 2
56 //---------------------------------
57 //write lcd controll register
58 void WC_LCD (unsigned char command)
59 {
60 1 isBusy();
61 1 LCDRS=0;
62 1 _nop_();
63 1 LCDRW=0;
64 1 _nop_();
65 1 _nop_();
66 1 DATABUS=command;
67 1 _nop_();
68 1 _nop_();
69 1 _nop_();
70 1 _nop_();
71 1 _nop_();
72 1 _nop_();
73 1 ENABLE=1;
74 1 _nop_();
75 1 _nop_();
76 1 _nop_();
77 1 _nop_();
78 1 _nop_();
79 1 _nop_();
80 1 ENABLE=0;
81 1 }
82 //----------------------------------------------
83 //LCD busy check ,check busy flag,read acc
84 //#pragma DISABLE
85
86 static void isBusy(void)
87 {
88 1 unsigned char data i;
89 1 for(i=100;i--;);
90 1 RESET_DOG;
91 1
92 1 /*
93 1 unsigned char data i;
94 1 i=ACC;
95 1 P8255D=0x90;//AiBoCo;
96 1 P0=0x0ff;
97 1 _nop_();
98 1 LCDRS=0;
99 1 LCDRW=1;
100 1 _nop_();
101 1 ENABLE=1;
102 1 _nop_();
103 1 do { ACC=DATABUS; } while(BUSYFLAG);
104 1 ENABLE=0;
105 1 P8255D=0x80;//AoBoCo;
106 1 ACC=i;
107 1 */
108 1 }
109 //------------------------------------------------
110 //init lcd
111
112 void clear(void)
113 {
114 1 WC_LCD(0x18);//base command,8bit
115 1 isBusy();
116 1 LCDRS=0;
117 1 LCDRW=0;
C51 COMPILER V7.20 LCDP 06/20/2005 16:55:58 PAGE 3
118 1 _nop_();
119 1 _nop_();
120 1 DATABUS=0x1;
121 1 _nop_();
122 1 _nop_();
123 1 _nop_();
124 1 ENABLE=1;
125 1 delay(4);
126 1 ENABLE=0;
127 1 _nop_();
128 1 _nop_();
129 1 }
130
131
132 //---------------------------
133 //display string
134
135 void text(unsigned char sta,unsigned char *string)
136 {
137 1 if(sta)WC_LCD(sta);
138 1 while(*string)WD_LCD(*string++);
139 1 }
140
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 166 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 5
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 + -