?? adc.lst
字號:
C51 COMPILER V6.12 ADC 03/19/2008 16:07:29 PAGE 1
C51 COMPILER V6.12, COMPILATION OF MODULE ADC
OBJECT MODULE PLACED IN .\adc.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE .\adc.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <AT89X52.H>
2
3 unsigned char code dispbitcode[]={0xfe,0xfd,0xfb,0xf7,
4 0xef,0xdf,0xbf,0x7f};
5 unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,
6 0x6d,0x7d,0x07,0x7f,0x6f,0x00};
7 unsigned char dispbuf[8]={10,10,10,10,0,0,0,0};
8 unsigned char dispcount;
9 unsigned char getdata;
10 unsigned int temp;
11 unsigned char i;
12
13 sbit ST=P3^0;
14 sbit OE=P3^1;
15 sbit EOC=P3^2;
16 sbit CLK=P3^3;
17
18
19 void delay02s(void)
20 {
21 1 unsigned char i,j;
22 1 for(i=20;i>0;i--)
23 1 for(j=20;j>0;j--)
24 1 //for(k=248;k>0;k--)
25 1 ;
26 1 }
27
28
29
30 /*************************延時(shí)程序段************************/
31 void Delay(unsigned char times)
32 {
33 1 do{;}while(--times);
34 1 }
35
36 void dispchar(char infotext)
37 {
38 1
39 1 if (P1_0==0)
40 1 {
41 2 P1_1=0;
42 2 P2=dispcode[infotext/10];
43 2 delay02s();
44 2 P1_0=1;
45 2
46 2 } else
47 1 {
48 2 P1_0=0;
49 2 P2=dispcode[infotext%10];
50 2 delay02s();
51 2 P1_1=1;
52 2 }
53 1 delay02s();
54 1
55 1 }
C51 COMPILER V6.12 ADC 03/19/2008 16:07:29 PAGE 2
56
57 void main(void)
58 {
59 1 ST=0;
60 1 OE=0;
61 1 ET0=1;
62 1 ET1=1;
63 1 EA=1;
64 1 TMOD=0x12;
65 1 TH0=216;
66 1 TL0=216;
67 1 TH1=(65536-4000)/256;
68 1 TL1=(65536-4000)%256;
69 1 TR1=1;
70 1 TR0=1;
71 1 ST=1;
72 1 ST=0;
73 1 while(1)
74 1 {
75 2
76 2 if(EOC==1)
77 2 {
78 3 OE=1;
79 3 getdata=P0;
80 3 OE=0;
81 3
82 3 temp=getdata*235;
83 3 temp=temp/128;
84 3 i=5;
85 3 dispbuf[0]=10;
86 3 dispbuf[1]=10;
87 3 dispbuf[2]=10;
88 3 dispbuf[3]=10;
89 3 dispbuf[4]=10;
90 3 dispbuf[5]=0;
91 3 dispbuf[6]=0;
92 3 dispbuf[7]=0;
93 3
94 3
95 3
96 3 while(temp/10)
97 3 {
98 4 dispbuf[i]=temp%10;
99 4
100 4
101 4 temp=temp/10;
102 4 i++;
103 4 }
104 3 dispbuf[i]=temp;
105 3
106 3 ST=1;
107 3 ST=0;
108 3 }
109 2
110 2
111 2 dispchar(dispbuf[i-1]+dispbuf[i]*10);
112 2
113 2
114 2 // dispchar(dispbuf[0]*10);
115 2 }
116 1 }
117
C51 COMPILER V6.12 ADC 03/19/2008 16:07:29 PAGE 3
118 void t0(void) interrupt 1 using 0
119 {
120 1 CLK=~CLK;
121 1 }
122
123 void t1(void) interrupt 3 using 0
124 {
125 1
126 1 TH1=(65536-4000)/256;
127 1 TL1=(65536-4000)%256;
128 1 // P2=dispcode[dispbuf[dispcount]];
129 1 // P1=dispbitcode[dispcount];
130 1 if(dispcount==7)
131 1 {
132 2 P1=P1 | 0x80;
133 2 }
134 1 dispcount++;
135 1 if(dispcount==8)
136 1 {
137 2 dispcount=0;
138 2 }
139 1
140 1 }
141
142
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 283 ----
CONSTANT SIZE = 19 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 13 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -