📄 clock.lst
字号:
C51 COMPILER V8.12 CLOCK 11/14/2008 09:20:22 PAGE 1
C51 COMPILER V8.12, COMPILATION OF MODULE CLOCK
OBJECT MODULE PLACED IN clock.OBJ
COMPILER INVOKED BY: D:\新建文件夹 (2)\UV3\C51\BIN\C51.EXE clock.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include<reg52.h>
2 #include"lcd1602.h"
3 #include"ds18b20.h"
4 #include"ds18b20_2.h"
5 #include"ds18b20_3.h"
6 #include"ds18b20_4.h"
7 #define uchar unsigned char
8 #define uint unsigned int
9 #define TIMER0_COUNT 0xEE11
10 sbit SPK=P3^5;
11 sbit LED1=P3^6;
12 sbit LED2=P3^7;
13 bit flag;
14 uint wendu;
15 uint wendu1;
16 uint wendu2;
17 uint wendu3;
18 uchar count,timer0_tick,count=0;
19 static void timer0_initialize(void)
20 {
21 1 EA=0;
22 1 timer0_tick=0;
23 1 TR0=0;
24 1 TMOD=0X01;
25 1 TL0=(TIMER0_COUNT & 0X00FF);
26 1 TH0=(TIMER0_COUNT >> 8);
27 1 PT1=1;
28 1 ET0=1;
29 1 TR0=1;
30 1 EA=1;
31 1 }
32 void display_temp()
33 {
34 1
35 1 uchar A1,A2;
36 1 uchar A3,A4;
37 1 uchar A5,A6;
38 1 uchar A7,A8;
39 1
40 1 tmpchange();
41 1 wendu=tmp();
42 1 A1=wendu/10;
43 1 A2=wendu%10;
44 1 gotoxy(1,1);
45 1 display_data(A1);
46 1 display_string(".");
47 1 write_date(int_to_char[A2]);
48 1
49 1
50 1 tmpchange2();
51 1 wendu1=tmp2();
52 1 A3=wendu1/10;
53 1 A4=wendu1%10;
54 1 gotoxy(2,1);
55 1 display_data(A3);
C51 COMPILER V8.12 CLOCK 11/14/2008 09:20:22 PAGE 2
56 1 display_string(".");
57 1 write_date(int_to_char[A4]);
58 1
59 1 tmpchange3();
60 1 wendu2=tmp3();
61 1 A5=wendu2/10;
62 1 A6=wendu2%10;
63 1 gotoxy(1,7);
64 1 display_data(A5);
65 1 display_string(".");
66 1 write_date(int_to_char[A6]);
67 1
68 1 tmpchange4();
69 1 wendu3=tmp4();
70 1 A7=wendu3/10;
71 1 A8=wendu3%10;
72 1 gotoxy(2,7);
73 1 display_data(A7);
74 1 display_string(".");
75 1 write_date(int_to_char[A8]);
76 1
77 1 }
78
79
80
81
82
83
84
85
86
87
88 void timer0(void) interrupt 1
89 {
90 1 TR0=0;
91 1 TL0=(TIMER0_COUNT & 0X00FF);//设置Timer0低八位数值
92 1 TH0=(TIMER0_COUNT >> 8);//设置Timer0高八位数值
93 1 TR0=1;
94 1 count++;
95 1 if(count==10) display_temp();
96 1
97 1
98 1 }
99
100
101
102 void main()
103 {
104 1 init_lcd();
105 1 timer0_initialize();
106 1 gotoxy(1,1);
107 1 display_string("00.0C");
108 1 gotoxy(2,1);
109 1 display_string("00.0C");
110 1 while(1)
111 1 {
112 2 if((wendu>500) || (wendu1>500) || (wendu2>500) || (wendu3>500))
113 2 {
114 3
115 3 SPK=~SPK;
116 3 LED1=~LED1;
117 3
C51 COMPILER V8.12 CLOCK 11/14/2008 09:20:22 PAGE 3
118 3 delay(30);
119 3
120 3 }
121 2 else if ((wendu<100) || (wendu1<100) || (wendu2<100) || (wendu3<100))
122 2 {
123 3 SPK=~SPK;
124 3 delay(20);
125 3 LED2=~LED2;
126 3 }
127 2 }
128 1
129 1 }
130
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1597 ----
CONSTANT SIZE = 19 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 18 20
IDATA SIZE = ---- ----
BIT SIZE = 1 8
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -