📄 main.ls1
字号:
190 PUBLIC rh_l_l
191 PUBLIC rh_l_h
192 PUBLIC rh_h_l
193 PUBLIC rh_h_h
194 PUBLIC rh_m
195 PUBLIC temp_m
196 PUBLIC temp_pwm_L
197 PUBLIC temp_pwm_H
198 PUBLIC temp_l_l
199 PUBLIC temp_l_h
200 PUBLIC temp_h_l
201 PUBLIC temp_h_h
202 PUBLIC Counter
203 PUBLIC time_1s_flag
204 PUBLIC read_sht_flag
205 PUBLIC pca_temr
206 PUBLIC PCA_Initiate
207 PUBLIC pwm_rh_out
208 PUBLIC pwm_out
209 PUBLIC pwm_Init
210 PUBLIC mach_rh
211 PUBLIC mach_t
212 PUBLIC main
213
---- 214 RSEG ?BI?MAIN
0000 215 read_sht_flag: DBIT 1
0001 216 time_1s_flag: DBIT 1
217
---- 218 RSEG ?DT?MAIN
0000 219 Counter: DS 1
0001 220 temp_h_h: DS 1
0002 221 temp_h_l: DS 1
0003 222 temp_l_h: DS 1
0004 223 temp_l_l: DS 1
0005 224 temp_pwm_H: DS 2
0007 225 temp_pwm_L: DS 2
0009 226 temp_m: DS 4
000D 227 rh_m: DS 4
0011 228 rh_h_h: DS 1
0012 229 rh_h_l: DS 1
0013 230 rh_l_h: DS 1
0014 231 rh_l_l: DS 1
0015 232 rh_pwm_H: DS 2
0017 233 rh_pwm_L: DS 2
0019 234 start_flag: DS 1
001A 235 uart_rcv_flag: DS 1
236 ;
237 ; #include "cdltwk.h"
238 ;
239 ;
240 ;
241 ;
242 ;
243 ;
244 ; bit read_sht_flag; //读SHT10标志
245 ; bit time_1s_flag;
246 ; //=1, 温湿度传感器损坏标志
247 ;
248 ;
249 ;
250 ;
251 ;
252 ;
253 ;
254 ; void sht10_samp();
255 ; void rdsht10_state();
A51 MACRO ASSEMBLER MAIN 02/20/2009 14:03:12 PAGE 5
256 ;
257 ; uchar Counter;
258 ; uchar temp_h_h; //温度pwm转换高电平高位字节
259 ; uchar temp_h_l; //温度pwm转换高电平的低位字节
260 ; uchar temp_l_h; //温度pwm转换低电平的高位字节
261 ; uchar temp_l_l; //温度pwm转换低电平的高低字节
262 ; uint temp_pwm_H; //温度高电平字
263 ; uint temp_pwm_L; //温度低电平字
264 ; ulong temp_m;
265 ; ulong rh_m;
266 ; uchar rh_h_h; //湿度pwm转换高电平高位字节
267 ; uchar rh_h_l; //湿度pwm转换高电平低位字节
268 ; uchar rh_l_h; //湿度pwm转换低电平高位字节
269 ; uchar rh_l_l; //湿度pwm转换低电平低位字节
270 ; uint rh_pwm_H; //湿度高电平字
271 ; uint rh_pwm_L; //湿度低电平字
272 ;
273 ; uchar start_flag,uart_rcv_flag;
274 ;
275 ; void pwm_Init();
276 ; void pwm_out();
277 ; void PCA_Initiate();
278 ; void pca_temr();
279 ; void mach_t();
280 ; void mach_rh();
281 ; void pwm_rh_out();
282 ; void UART_out_temp(void);
283 ; void UART_out_rh(void);
284 ; void UART_out();
285 ; //-----------------------------------------------------------------------------
286 ;
287 ; /*void UART_INI(void)
288 ; {
289 ; TMOD=0X21; //则T0设为16位定时器
290 ; ET0=1; //开t0中断
291 ; //TR0=1; //开定时器0
292 ; P3M1=0x30; //设P3.4,P3.5推挽输出
293 ;
294 ; TH0 = 0xDC;
295 ; TL0 = 0xD8;
296 ; temp_h_h = 0xDC;
297 ; temp_h_l = 0xD8;
298 ; temp_l_h = 0xDC;
299 ; temp_l_l = 0xD8;
300 ;
301 ; #pragma asm
302 ; CLR P3.4
303 ; CLR P3.5
304 ; #pragma endasm
305 ;
306 ;
307 ; SCON = 0x50;
308 ; TMOD = 0x21;
309 ; TH1 = 0xFE;
310 ; TL1 = 0xFE;
311 ; PCON|=0x80;
312 ; TR1 = 1;
313 ; //PS = 1;
314 ; //ES =1 ;
315 ; TR0=1;
316 ; EA =1; //开t1,t0中断
317 ; }*/
318 ;
319 ;
320 ; main()
321
A51 MACRO ASSEMBLER MAIN 02/20/2009 14:03:12 PAGE 6
---- 322 RSEG ?PR?main?MAIN
0000 323 main:
324 USING 0
325 ; SOURCE LINE # 85
326 ; {
327 ; SOURCE LINE # 86
328 ; // uint k;
329 ; //uchar temp[4];
330 ; pwm_Init();
331 ; SOURCE LINE # 89
0000 1100 F 332 ACALL pwm_Init
333 ; //UART_INI();
334 ;
335 ; PCA_Initiate();
336 ; SOURCE LINE # 92
0002 1100 F 337 ACALL PCA_Initiate
0004 338 ?C0001:
339 ; //rdsht10_state();
340 ; while(1)
341 ; SOURCE LINE # 94
342 ; { //uart_send_byte(0X31);
343 ; SOURCE LINE # 95
344 ;
345 ; sht10_samp();
346 ; SOURCE LINE # 97
0004 1100 F 347 ACALL sht10_samp
348 ; //mach_t();
349 ; //mach_rh();
350 ; //UART_out();
351 ;
352 ; //for(k=0;k<40000;k++);
353 ; //uart_send_byte(out_temp/256);
354 ; //uart_send_byte(out_temp);
355 ; //for(k=0;k<40000;k++);
356 ; // temp[0]=out_temp/1000;
357 ; // temp[1]=out_temp/100%10;
358 ; // temp[2]=out_temp/10%10;
359 ; // temp[3]=out_temp%10;
360 ; // uart_send1(temp,4);
361 ; //for(k=0;k<40000;k++);
362 ;
363 ; }
364 ; SOURCE LINE # 113
0006 80FC 365 SJMP ?C0001
0008 366 ?C0002:
367 ; }
368 ; SOURCE LINE # 114
0008 369 ?C0003:
0008 22 370 RET
371 ; END OF main
372
373 ;
374 ;
375 ; void mach_t(void)
376
---- 377 RSEG ?PR?mach_t?MAIN
0000 378 mach_t:
379 USING 0
380 ; SOURCE LINE # 117
381 ; /******************************************************************************
382 ; 功能 : 计算温度转换成对应的脉宽
383 ; 入口 : out_temp
384 ; 出口 : temp_pwm_H,temp_pwm_L
385 ; ******************************************************************************/
386 ; {
387 ; SOURCE LINE # 123
A51 MACRO ASSEMBLER MAIN 02/20/2009 14:03:12 PAGE 7
388 ; //temp_m=(out_temp+200)*32/5*2+2880; //计算温度电流ma视
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -