📄 s6b07x.lst
字号:
C51 COMPILER V7.07 S6B07X 09/10/2005 11:32:45 PAGE 1
C51 COMPILER V7.07, COMPILATION OF MODULE S6B07X
OBJECT MODULE PLACED IN S6b07x.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE S6b07x.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include "define.h"
2 #include "cpu8052.h"
3 #include "global.h"
4 #include "delay.h"
5 #include "S6b07x.h"
6
7
8 // Instruction S6b07x
9
10 #define Display_ON 0xAF
11 #define Display_OFF 0xAE
12 #define Initial_Display_Line 0x40
13
14 #define Set_page_address 0xB0
15 #define Set_column_address_MSB 0x10
16 #define Set_column_address_LSB 0x00
17
18 #define ADC_select 0xA0
19 #define LCD_bias_select 0xA3
20 #define SHL_select 0xC8
21
22 #define Power_control_0 0x28
23 #define Power_control_1 0x2C
24 #define Power_control_2 0x2E
25 #define Power_control_3 0x2F
26
27 #define Regulator_resistor_select 0x25
28 #define Set_reference_voltage 0x81
29
30
31
32 void Sub_Initalize(Byte Contrast)
33 {
34 1
35 1 LcdSub_Send_Command_Func(ADC_select);
36 1 LcdSub_Send_Command_Func(SHL_select);
37 1 LcdSub_Send_Command_Func(LCD_bias_select);
38 1
39 1 LcdSub_Send_Command_Func(Power_control_1);
40 1 DelayX1ms1(10);
41 1 LcdSub_Send_Command_Func(Power_control_2);
42 1 DelayX1ms1(2);
43 1 LcdSub_Send_Command_Func(Power_control_3);
44 1 DelayX1ms1(2);
45 1
46 1 LcdSub_Send_Command_Func(Regulator_resistor_select);
47 1
48 1 LcdSub_Clear();
49 1 LcdSub_Contrast(Contrast);
50 1
51 1 LcdSub_Send_Command_Func(Initial_Display_Line);
52 1 LcdSub_Send_Command_Func(Display_ON);
53 1
54 1 }
55
C51 COMPILER V7.07 S6B07X 09/10/2005 11:32:45 PAGE 2
56
57 void Sub_Off(void)
58 {
59 1
60 1 LcdSub_Send_Command_Func(Display_OFF);
61 1
62 1 LcdSub_Send_Command_Func(0x2d);
63 1 DelayX1ms1(100);
64 1 LcdSub_Send_Command_Func(0x2c);
65 1 DelayX1ms1(5);
66 1 LcdSub_Send_Command_Func(0x28);
67 1 DelayX1ms1(5);
68 1
69 1 }
70
71 void LcdSub_Send_Command_Func(unsigned char Lcd_Command)
72 {
73 1 // char xdata *ptr ;
74 1
75 1 CS1 = 1;
76 1 CS2 = 0;
77 1
78 1 RS = 0;
79 1 P0 = Lcd_Command;
80 1 WR = HI;
81 1 WR = LO;
82 1 WR = HI;
83 1
84 1 }
85
86
87
88 void LcdSub_Send_Data_Func(unsigned char Lcd_Data)
89 {
90 1
91 1 // char xdata *ptr ;
92 1
93 1 CS1 = 1;
94 1 CS2 = 0;
95 1
96 1 RS = 1;
97 1 P0 = Lcd_Data ;
98 1 WR = HI;
99 1 WR = LO;
100 1 WR = HI;
101 1
102 1
103 1 }
104
105
106 void LcdSub_Contrast(unsigned char Contrast)
107 {
108 1 LcdSub_Send_Command_Func(Set_reference_voltage);
109 1 LcdSub_Send_Command_Func(Contrast);
110 1 LcdSub_ShowNum(Contrast);
111 1 }
112
113
114
115 void LcdSub_Address(unsigned char Page,unsigned char Address)
116 {
117 1
C51 COMPILER V7.07 S6B07X 09/10/2005 11:32:45 PAGE 3
118 1 LcdSub_Send_Command_Func(Set_page_address|(Page & 0x0f) );
119 1 LcdSub_Send_Command_Func(Set_column_address_MSB | ( Address>>4 ));
120 1 LcdSub_Send_Command_Func(Set_column_address_LSB | ( Address&0x0F));
121 1
122 1 }
123
124 void LcdSub_Black(void)
125 {
126 1 Byte i,j;
127 1
128 1 for(i=0; i<8; i++)
129 1 {
130 2 LcdSub_Address(i,0x00);
131 2 for(j=0; j<96; j++)
132 2 {
133 3 LcdSub_Send_Data_Func(0xff);
134 3 }
135 2
136 2 }
137 1 }
138
139 void LcdSub_Clear(void)
140 {
141 1 Byte i,j;
142 1
143 1 for(i=0; i<8; i++)
144 1 {
145 2 LcdSub_Address(i,0x00);
146 2 for(j=0; j<96; j++)
147 2 {
148 3 LcdSub_Send_Data_Func(0x00);
149 3 }
150 2 }
151 1 }
152
153 void LcdSub_Dot(void)
154 {
155 1 Byte i,j;
156 1
157 1 for(i=0; i<8; i++)
158 1 {
159 2 LcdSub_Address(i,0x00);
160 2 for(j=0; j<48; j++)
161 2 {
162 3 LcdSub_Send_Data_Func(0xaa);
163 3 LcdSub_Send_Data_Func(0x55);
164 3 }
165 2 }
166 1 }
167
168
169 void LcdSub_Frame(void)
170 {
171 1 Byte i,j;
172 1
173 1 LcdSub_Address(0,0x00);
174 1 LcdSub_Send_Data_Func(0xff);
175 1 for(j=0; j<94; j++)
176 1 {
177 2 LcdSub_Send_Data_Func(0x01);
178 2 }
179 1 LcdSub_Send_Data_Func(0xff);
C51 COMPILER V7.07 S6B07X 09/10/2005 11:32:45 PAGE 4
180 1 //
181 1
182 1 for(i=1; i<7; i++)
183 1 {
184 2 LcdSub_Address(i,0x00);
185 2 LcdSub_Send_Data_Func(0xff);
186 2 for(j=0; j<94; j++)
187 2 {
188 3 LcdSub_Send_Data_Func(0x00);
189 3 }
190 2 LcdSub_Send_Data_Func(0xff);
191 2 }
192 1 //
193 1 LcdSub_Address(7,0x00);
194 1 LcdSub_Send_Data_Func(0xff);
195 1 for(j=0; j<94; j++)
196 1 {
197 2 LcdSub_Send_Data_Func(0x80);
198 2 }
199 1 LcdSub_Send_Data_Func(0xff);
200 1
201 1 }
202
203
204 void LcdSub_Dot4x4(void)
205 {
206 1 Byte i,j;
207 1
208 1 for(i=0; i<8; i++)
209 1 {
210 2 LcdSub_Address(i,0x00);
211 2 for(j=0; j<12; j++)
212 2 {
213 3 LcdSub_Send_Data_Func(0xf0);
214 3 LcdSub_Send_Data_Func(0xf0);
215 3 LcdSub_Send_Data_Func(0xf0);
216 3 LcdSub_Send_Data_Func(0xf0);
217 3 LcdSub_Send_Data_Func(0x0f);
218 3 LcdSub_Send_Data_Func(0x0f);
219 3 LcdSub_Send_Data_Func(0x0f);
220 3 LcdSub_Send_Data_Func(0x0f);
221 3 }
222 2 } //
223 1
224 1 LcdSub_Address(4,0x00);
225 1 for (i=1; i<=12; i++)
226 1 {
227 2 LcdSub_Num(i-(i/10)*10);
228 2 }
229 1
230 1 for (i=1; i<=8; i++)
231 1 {
232 2 LcdSub_Address(i-1,32);
233 2 LcdSub_Num(i);
234 2 }
235 1
236 1
237 1 }
238
239
240 Byte code DISPLAY_Num[10][8] =
241 {
C51 COMPILER V7.07 S6B07X 09/10/2005 11:32:45 PAGE 5
242 0x00,0x3c,0x42,0x42,0x42,0x42,0x3c,0x00, //"0"
243 0x00,0x40,0x40,0x44,0x7e,0x40,0x40,0x00, //"1"
244 0x00,0x44,0x62,0x52,0x4a,0x4a,0x44,0x00, //"2"
245 0x00,0x24,0x42,0x42,0x4a,0x4a,0x34,0x00, //"3"
246 0x00,0x20,0x30,0x28,0x24,0x7e,0x20,0x00, //"4"
247 0x00,0x2e,0x4a,0x4a,0x4a,0x4a,0x32,0x00, //"5"
248 0x00,0x3c,0x4a,0x4a,0x4a,0x4a,0x30,0x00, //"6"
249 0x00,0x06,0x02,0x72,0x7a,0x0a,0x06,0x00, //"7"
250 0x00,0x34,0x4a,0x4a,0x4a,0x4a,0x34,0x00, //"8"
251 0x00,0x0c,0x52,0x52,0x52,0x52,0x3c,0x00, //"9"
252
253 };
254
255
256 void LcdSub_Num(Byte NN)
257 {
258 1 Byte j;
259 1
260 1 for(j=0; j<8; j++)
261 1 {
262 2 LcdSub_Send_Data_Func(DISPLAY_Num[NN][j]);
263 2 }
264 1
265 1 }
266
267 void LcdSub_ShowNum(Byte NN)
268 {
269 1
270 1 Byte j;
271 1
272 1 LcdSub_Address(3,32);
273 1
274 1 for(j=0; j<8; j++)
275 1 {
276 2 LcdSub_Send_Data_Func((DISPLAY_Num[(NN/100)][j])^0xff);
277 2 }
278 1 for(j=0; j<8; j++)
279 1 {
280 2 LcdSub_Send_Data_Func((DISPLAY_Num[((NN-(NN/100)*100)/10)][j])^0xff);
281 2 }
282 1 for(j=0; j<8; j++)
283 1 {
284 2 LcdSub_Send_Data_Func((DISPLAY_Num[(NN-(NN/10)*10)][j])^0xff);
285 2 }
286 1
287 1 }
288
289
290
291
292
293
294 void LcdSub_NBar(void)
295 {
296 1 Byte i,j,k;
297 1
298 1 for(i=0; i<8; i++)
299 1 {
300 2 LcdSub_Address(i,0x00);
301 2 for(j=0; j<12; j++)
302 2 {
303 3 LcdSub_Send_Data_Func(0x00);
C51 COMPILER V7.07 S6B07X 09/10/2005 11:32:45 PAGE 6
304 3 LcdSub_Send_Data_Func(0xff);
305 3 LcdSub_Send_Data_Func(0xff);
306 3 LcdSub_Send_Data_Func(0xff);
307 3 LcdSub_Send_Data_Func(0xff);
308 3 LcdSub_Send_Data_Func(0xff);
309 3 LcdSub_Send_Data_Func(0xff);
310 3 LcdSub_Send_Data_Func(0x00);
311 3 }
312 2 } //
313 1
314 1 k=8;
315 1 for(i=0; i<12; i++)
316 1 {
317 2 for(j=1; j<k; j++)
318 2 {
319 3 LcdSub_Address(j-1,i*8);
320 3 LcdSub_Num(j);
321 3 }
322 2
323 2 k--;
324 2 if (k==1)
325 2 {
326 3 k=8;
327 3 }
328 2 } //
329 1 }
330
331 void LcdSub_Select(Byte N2)
332 {
333 1 Byte i;
334 1 i=N2-(N2/5)*5;
335 1 switch(i)
336 1 {
337 2 case(0) :
338 2 LcdSub_Black( );
339 2 break;
340 2 case(1) :
341 2 LcdSub_Dot( );
342 2 break;
343 2 case(2) :
344 2 LcdSub_Frame( );
345 2 break;
346 2 case(3) :
347 2 LcdSub_Dot4x4( );
348 2 break;
349 2 case(4) :
350 2 LcdSub_NBar( );
351 2 break;
352 2 }
353 1
354 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 771 ----
CONSTANT SIZE = 80 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 2
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILER V7.07 S6B07X 09/10/2005 11:32:45 PAGE 7
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -