📄 1335c51.lst
字号:
C51 COMPILER V8.08 1335C51 04/26/2008 21:36:20 PAGE 1
C51 COMPILER V8.08, COMPILATION OF MODULE 1335C51
OBJECT MODULE PLACED IN 1335c51.OBJ
COMPILER INVOKED BY: D:\Keil C51\C51\BIN\C51.EXE 1335c51.c DEBUG OBJECTEXTEND
line level source
1 //#pragma src
2 #include <reg52.h>
3 #include <stdlib.h>
4 #include <intrins.h>
5 #include <stdio.h>
6 #include <absacc.h>
7 #include"zimo.h"
8 #include"define.h"
9 //================================= 演示主程序 =================================
10 Uchar keyscan(void) ;
11 void PutCdotInGraph( Uint Ox, Uchar Oy, Uchar Cnumber, Uchar DotWidth,Uchar attribs ) ;
12 sbit P1_0=P1^0;
13 sbit P1_1=P1^1;
14 sbit P1_2=P1^2;
15 sbit P1_3=P1^3;
16 sbit P3_3=P3^3; //kk标志位,平时为低,记数完毕后为高,数被读走后又为低
17 void Main( void )
18 {
19 1 Uchar b,c,k;
20 1 Uchar rval;
21 1 Uchar m;
22 1 // Uchar i,j;
23 1 Delay(32768); // 足够的延时确保lcm已经准备好
24 1 LcmInition();
25 1 LcmClear();
26 1 PutWordInGraph();
27 1 dprintf(1,56,ASC0,1); //8个通道的通道号
28 1 dprintf(1,74,ASC1,1);
29 1 dprintf(1,92,ASC2,1);
30 1 dprintf(1,110,ASC3,1);
31 1 dprintf(1,128,ASC4,1);
32 1 dprintf(1,146,ASC5,1);
33 1 dprintf(1,164,ASC6,1);
34 1 dprintf(1,182,ASC7,1);
35 1 dprintf(0,222,BenDi,1);
36 1
37 1 /* WriteCommand( DispOn ); // 写入指令代码
38 1 WriteData( 0x16 );
39 1
40 1
41 1
42 1 WriteCommand( CsrDirR ); // 自动右移光标指向
43 1
44 1 WriteCommand( CsrW ); // 制定光标位置
45 1 WriteData(0x04); // 设置光标地址CSR
46 1 WriteData(0x00);
47 1
48 1
49 1 WriteCommand( mWrite );
50 1 WriteData(0x59);
51 1 WriteData(0x45);
52 1 WriteData(0x57);
53 1 WriteData(0x45);
54 1 WriteData(0x49);
55 1 */
C51 COMPILER V8.08 1335C51 04/26/2008 21:36:20 PAGE 2
56 1 // while(1);
57 1
58 1 // PutWordInGraph(); //继电器菜单
59 1
60 1 // while(1);
61 1
62 1 do //以keyscan为主线的循环
63 1 {
64 2 b=keyscan();
65 2 if(b==2)
66 2 {
67 3 dprintf(0,0,TestJi,1); //测继电器界面的提示菜单
68 3 dprintf(5,32,SheZhi,1);
69 3 dprintf(5,222,JiDianQi,1);
70 3 }
71 2 else if(b==3)
72 2 {
73 3 dprintf(0,0,TestJing,1); //测晶振界面的提示菜单
74 3 dprintf(5,32,BiaoCheng,1);
75 3 dprintf(5,222,JingZheng,1);
76 3 }
77 2 else if(b==1) //设置分频,对分频好之后用变量m记录下来
78 2 {
79 3 DelayMs(10);
80 3 if(b==1)
81 3 {
82 4 c++;
83 4 if(c==9)c=0;
84 4 // while(b==2);
85 4 }
86 3 switch(c)
87 3 {
88 4 case 1:dprintf(18,222,Period0,1); m=0x10;break;
89 4 case 2:dprintf(18,222,Period1,1);m=0x11;break;
90 4 case 3:dprintf(18,222,Period2,1);m=0x12; break;
91 4 case 4:dprintf(18,222,Period3,1);m=0x13; break;
92 4 case 5:dprintf(18,222,Period4,1);m=0x14; break;
93 4 case 6:dprintf(18,222,Period5,1);m=0x15; break;
94 4 case 7:dprintf(18,222,Period6,1);m=0x16; break;
95 4 case 8:dprintf(18,222,Period7,1);m=0x17; break;
96 4 case 0: dprintf(18,222,Next,1); break;
97 4
98 4 }
99 3 }
100 2 else if(b==6) //在分频的基础上送一个启动信号,开始进行测量 所以要先设置再启动。
101 2 {
102 3 XBYTE[0X8010]=m&0xf7;
103 3 XBYTE[0X8010]=m|0x08;
104 3 XBYTE[0X8010]=m&0xf7;
105 3 while(P3_3==0) ;
106 3 DATARD0();
107 3 TestDisplay();
108 3 TryDisplay13(24,56,Rslt0);
109 3 }
110 2 WriteCommand( DispOn ); // 写入指令代码
111 2 WriteData( 0x16 );
112 2
113 2
114 2
115 2 WriteCommand( CsrDirR ); // 自动右移光标指向
116 2
117 2 WriteCommand( CsrW ); // 制定光标位置
C51 COMPILER V8.08 1335C51 04/26/2008 21:36:20 PAGE 3
118 2 WriteData(0x04); // 设置光标地址CSR
119 2 WriteData(0x00);
120 2
121 2
122 2 WriteCommand( mWrite );
123 2 WriteData(0x59);
124 2 WriteData(0x45);
125 2 WriteData(0x57);
126 2 WriteData(0x45);
127 2 WriteData(0x49);
128 2
129 2 // else{;}
130 2 }while(1);
131 1
132 1 }
*** WARNING C280 IN LINE 19 OF 1335C51.C: 'k': unreferenced local variable
*** WARNING C280 IN LINE 20 OF 1335C51.C: 'rval': unreferenced local variable
133
134 /************************键盘扫描***************************************/
135 Uchar keyscan(void)
136 {
137 1 Uchar i,a=0;
138 1 for(i=0;i<8;i++)
139 1 {
140 2 P1_0=1;
141 2 P1_1=0;
142 2 P1_1=1;
143 2 }
144 1 P1_0=0;
145 1 P1_1=0;
146 1 P1_1=1;
147 1 for(i=0;i<9;i++)
148 1 {
149 2 if(P1_2==0)
150 2 { //i代表0的移位
151 3 if (i==1) a=1; //i=1~4,负责两行键盘,要用端口线判别一下
152 3 else if (i==2) a=2;
153 3 else if (i==3) a=3;
154 3 else if (i==4) a=4;
155 3 else if (i==5) a=5;
156 3 else if (i==6) a=6;
157 3 else if (i==7) a=7;
158 3 else if (i==8) a=8;
159 3 else {;}
160 3 }
161 2 if(P1_3==0)
162 2 {
163 3 if (i==1) a=9;
164 3 else if (i==2) a=10;
165 3 else if (i==3) a=11;
166 3 else if (i==4) a=12;
167 3 else {;}
168 3 }
169 2
170 2 P1_1=0;
171 2 P1_0=1;
172 2 P1_1=1;
173 2 }
174 1
175 1 // return a;
176 1 }
*** WARNING C173 IN LINE 176 OF 1335C51.C: missing return-expression
C51 COMPILER V8.08 1335C51 04/26/2008 21:36:20 PAGE 4
177
178
179 /**********************读数据********************************/
180 void DATARD0()
181 {
182 1 Uchar dat;
183 1 dat=DATARD00;
184 1 temp[0]=dat&0x0f;
185 1 temp[1]=(dat&0xf0)/16;
186 1 dat=DATARD01;
187 1 temp[2]=dat&0x0f;
188 1 temp[3]=(dat&0xf0)/16;
189 1 dat=DATARD02;
190 1 temp[4]=dat&0x0f;
191 1 temp[5]=(dat&0xf0)/16;
192 1 dat=DATARD03;
193 1 temp[6]=dat&0x0f;
194 1 temp[7]=(dat&0xf0)/16;
195 1 dat=DATARD04;
196 1 temp[8]=dat&0x0f;
197 1 temp[9]=(dat&0xf0)/16;
198 1 dat=DATARD05;
199 1 temp[10]=dat&0x0f;
200 1 temp[11]=(dat&0xf0)/16;
201 1 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -