📄 vf3em0.lst
字号:
C51 COMPILER V3.20, SN-50203013 VF3EM0 09/14/06 14:54:47 PAGE 1
DOS C51 COMPILER V3.20, COMPILATION OF MODULE VF3EM0
OBJECT MODULE PLACED IN VF3EM0.OBJ
COMPILER INVOKED BY: F:\COMP51\BIN\C51.EXE VF3EM0.C DB OE SMALL ROM(LARGE)
stmt level source
1 #define uchar unsigned char
2 #define uint unsigned int
3 #define ulong unsigned long
4 #define nop _nop_()
5
6 #pragma ROM(LARGE)
7 #pragma RB(0)
8 #pragma ot(5,SIZE)
9
10 #include<reg52.h>
11 #include<pub.h>
12 #include<absacc.h>
13 #include<intrins.h>
14 #include <24c256h.h>
15 #include <pcf8563.h>
16
17 #include <EMrfc.h>
18 //#include <TIrfc.h>
19
20 uint data RecordNum;
21
22 /******************* lcddisp.c *****************/
23 uchar DispBuff[4];
24
25 uchar code DispCode[16]=
26 {
27 0xeb,0x0a,0xad,0x8f,0x4e,0xc7,0xe7,0x8a,0xef,0xcf, /*0~9*/
28 0xee,0x67,0xe1,0x2f,0xe5,0xe4, /*A,b,C,d,E,F*/
29 //0x04,0x85,0xe1,0x8b,0xe5,0x64,0x1 /*-,三,[,],E,r,_*/
30 };
31
32 void wrLcdCode(uchar byte)
33 {
34 1 uchar i;
35 1
36 1 LCDCS=0;
37 1 LCDDA=1; LCDWR=0; LCDWR=1;
38 1 LCDDA=0; LCDWR=0; LCDWR=1;
39 1 LCDDA=0; LCDWR=0; LCDWR=1;
40 1
41 1 for (i=0;i<8;i++)
42 1 {
43 2 if ( byte>=0x80 ) LCDDA=1;
44 2 else LCDDA=0;
45 2 LCDWR=0;LCDWR=1;
46 2 byte<<=1;
47 2 }
48 1 LCDDA=0; LCDWR=0;LCDWR=1;
49 1
50 1 LCDDA=1;
51 1 LCDCS=1;
52 1 }
53
54 void wrLcdDisp()
55 {
C51 COMPILER V3.20, SN-50203013 VF3EM0 09/14/06 14:54:47 PAGE 2
56 1 uchar i,j;
57 1 uchar byte;
58 1 uchar addr;
59 1
60 1 LCDCS=0;
61 1 LCDDA=1; LCDWR=0; LCDWR=1;
62 1 LCDDA=0; LCDWR=0; LCDWR=1;
63 1 LCDDA=1; LCDWR=0; LCDWR=1;
64 1 LCDDA=0; LCDWR=0; LCDWR=1;
65 1
66 1 for ( i=0;i<5;i++ )
67 1 {
68 2 LCDDA=0; LCDWR=0; LCDWR=1;
69 2 }
70 1 for ( j=0;j<4;j++ )
71 1 {
72 2 byte=DispBuff[j];
73 2 for ( i=0;i<8;i++ )
74 2 {
75 3 if ( byte>=0x80 ) LCDDA=1;
76 3 else LCDDA=0;
77 3 LCDWR=0; LCDWR=1;
78 3 byte<<=1;
79 3 }
80 2 }
81 1 LCDDA=1;
82 1 LCDCS=1;
83 1 }
84
85 void dispChar(uchar loc, uchar byte)
86 {
87 1 DispBuff[loc]=DispCode[byte];
88 1 }
89
90 void clrDisp()
91 {
92 1 uchar i;
93 1 // for ( i=0;i<4;i++ ) DispBuff[i]=0x0;
94 1 DispBuff[0]=0;
95 1 DispBuff[1]=0;
96 1 DispBuff[2]=0;
97 1 DispBuff[2]=0;
98 1
99 1 wrLcdDisp();
100 1 }
101 /*
void closeLCD()
{
wrLcdCode(02);
}
*/
107 void initDisp()
108 {
109 1 uchar data i;
110 1
111 1 LCDCS=1; LCDWR=1; LCDRD=1; LCDDA=1;
112 1 LCDCS=0; for ( i=0;i<10;i++ );
113 1 LCDCS=1; for ( i=0;i<10;i++ );
114 1 LCDCS=0; for ( i=0;i<10;i++ );
115 1 LCDCS=1; for ( i=0;i<10;i++ );
116 1 LCDCS=0; for ( i=0;i<10;i++ );
117 1 LCDCS=1; for ( i=0;i<10;i++ );
C51 COMPILER V3.20, SN-50203013 VF3EM0 09/14/06 14:54:47 PAGE 3
118 1 wrLcdCode(0x29); // initlcd
119 1 wrLcdCode(0x18);
120 1 wrLcdCode(0x01);
121 1 wrLcdCode(0x03);
122 1 }
123 /******************* lcddisp.c *****************/
124
125
126 uchar WorkTime;
127
128 uchar data recbuf[20];
129 uchar data RecLen;
130
131 void music()
132 {
133 1 uint i;
134 1
135 1 for ( i=0;i<139*4;i++ )
136 1 {
137 2 Bell=1; TR0=0;TF0=0;TH0=0xff;TL0=0x91;TR0=1;
138 2 while ( !TF0 ); TF0=0;
139 2 Bell=0; TR0=0;TF0=0;TH0=0xff;TL0=0x91;TR0=1;
140 2 while ( !TF0 ); TF0=0;
141 2 }
142 1 Bell = 1;
143 1 }
144
145 /* 延时n个uS */
146 void delayNus(uint nus)
147 {
148 1 TR0=0;/*先停止计数*/
149 1 nus = 0xffff- nus;
150 1 TF0=0; TL0=(uchar)nus; TH0=nus/0x100;
151 1 TR0=1;
152 1 while( !TF0 );
153 1 TF0=0;
154 1 }
155
156 void delayN10ms(uchar t)
157 {
158 1 uchar i;
159 1 for(i=0;i<t;i++) delayNus(10000);
160 1 }
161
162 void powerDown()
163 {
164 1 Shake=1;
165 1 PowerEN=1;
166 1 SHD=1;
167 1 PCON=0X2;
168 1 }
169
170 void initComm()
171 {
172 1 RecLen=0;
173 1 // delayN10ms(2);
174 1 ES = 0; /*禁止串行口中断*/
175 1 ET1= 0; /*禁止定时器1中断*/
176 1 TMOD = 0x21;
177 1 PCON = 0x00; /*波特率加倍位*/
178 1 TH1 = 0xf4; /*串行口的波特率加倍后为2400,8BIT*/
179 1 TL1 = 0xf4;
C51 COMPILER V3.20, SN-50203013 VF3EM0 09/14/06 14:54:47 PAGE 4
180 1 SCON = 0x40;
181 1 TR1 = 1;
182 1 REN = 1;
183 1 RI = 0;TI = 0;
184 1 }
185
186 void sendChar(uchar tt)
187 {
188 1 SBUF=tt; while (!TI); TI=0;
189 1 }
190
191 void sendMsg()
192 {
193 1 sendChar(0xeb); sendChar(0x80); sendChar(1);
194 1 sendChar(0x00);
195 1 sendChar(0x6c);
196 1 }
197
198 void testLed()
199 {
200 1 uint i;
201 1
202 1 RunLed=0;
203 1 for ( i=0;i<1000;i++);
204 1 RunLed=1;
205 1 sendMsg();
206 1 }
207
208 void testBell()
209 {
210 1 music();
211 1 sendMsg();
212 1 }
213
214 void sendClock()
215 {
216 1 uchar check_byte,i;
217 1
218 1 getClock();
219 1
220 1 recbuf[0]=0xeb;
221 1 recbuf[1]=0x32;
222 1 recbuf[2]=6;
223 1 recbuf[3]=Clock.Year;
224 1 recbuf[4]=Clock.MonthCentury;
225 1 recbuf[5]=Clock.Day;
226 1 recbuf[6]=Clock.Hour;
227 1 recbuf[7]=Clock.Min;
228 1 recbuf[8]=Clock.Sec;
229 1
230 1 check_byte=0;
231 1 for ( i=0;i<9;i++ )
232 1 {
233 2 check_byte+=recbuf[i];
234 2 sendChar(recbuf[i]);
235 2 }
236 1 sendChar( check_byte );
237 1 }
238
239 void pcSetClock()
240 {
241 1 Clock.Sec=recbuf[8];
C51 COMPILER V3.20, SN-50203013 VF3EM0 09/14/06 14:54:47 PAGE 5
242 1 Clock.Min=recbuf[7];
243 1 Clock.Hour=recbuf[6];
244 1 Clock.Day=recbuf[5];
245 1 Clock.MonthCentury=recbuf[4];
246 1 Clock.Year=recbuf[3];
247 1 setClock();
248 1 sendMsg();
249 1 }
250
251 void readRecordNum()
252 {
253 1 RecordNum = rd24c256(0x28);
254 1 RecordNum *= 256;
255 1 RecordNum = RecordNum + rd24c256(0x29);
256 1 RecordNum *= 64;
257 1 RecordNum += (rdPCF8563Byte(0xb)&0x3f);
258 1 }
259
260
261 void rdSysInfo()
262 {
263 1 uchar addr,len;
264 1 uchar i,CheckNum;
265 1 uchar byte;
266 1
267 1 addr=recbuf[3];
268 1 len=recbuf[4];
269 1
270 1 if ( addr==8 )
271 1 {
272 2 readRecordNum();
273 2 sendChar(0xeb); sendChar(0x36); sendChar(6);
274 2 CheckNum=0xeb+0x36+6;
275 2 sendChar(RecordNum/256); sendChar((uchar)RecordNum);
276 2 sendChar(0);sendChar(0);
277 2 sendChar(RecordNum/256);sendChar(RecordNum%256);
278 2 CheckNum+=(RecordNum/256+RecordNum%256+RecordNum/256+RecordNum%256);
279 2 sendChar(CheckNum);
280 2 return;
281 2 }
282 1 else;
283 1 sendChar(0xeb); sendChar(0x36); sendChar(len);
284 1 CheckNum=0xeb+0x36+len;
285 1 for ( i=0;i<len;i++ )
286 1 {
287 2 byte=rd24c256(addr+i);
288 2 CheckNum+=byte;
289 2 sendChar(byte);
290 2 }
291 1 sendChar(CheckNum);
292 1 }
293
294 void clrRecord();
295
296 void wrSysInfo()
297 {
298 1 uchar addr,len;
299 1 uchar i;
300 1
301 1 addr=recbuf[3];
302 1 len =recbuf[4]-2;
303 1
C51 COMPILER V3.20, SN-50203013 VF3EM0 09/14/06 14:54:47 PAGE 6
304 1 if ( addr==0 )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -