📄 io_check.lst
字号:
C51 COMPILER V8.16 IO_CHECK 01/30/2009 21:42:47 PAGE 1
C51 COMPILER V8.16, COMPILATION OF MODULE IO_CHECK
OBJECT MODULE PLACED IN .\OBJ\IO_CHECK.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE SRC\IO_CHECK.C BROWSE DEBUG OBJECTEXTEND PRINT(.\LST\IO_CHECK.lst) OBJECT(.
-\OBJ\IO_CHECK.obj)
line level source
1 /**************************************************************************************/
2 #include "config.h"
3
4 /**************************************************************************************/
5 uint8 demp; //定时0时间
6 uint8 demp1; //定时1时间
7 /**************************************************************************************/
8 bit X0=1,X1=1,X2=1,X3=1,X4=1,X5=1,X6=1,X7=1; //输入
9 bit X10=1,X11=1,X12=1,X13=1,X14=1,X15=1,X16=1,X17=1; //输入
10 bit X20=1,X21=1,X22=1,X23=1,X24=1,X25=1; //输入
11 /**************************************************************************************/
12 /*********消抖时间******************/
13 extern uint8 TSS1;
14 //判断X0消抖值
15 uint8 xdata InP0=0,InP1=0,InP2=0,InP3=0,InP4=0,InP5=0,InP6=0,InP7=0;
16 uint8 xdata InP10=0,InP11=0,InP12=0,InP13=0,InP14=0,InP15=0,InP16=0,InP17=0;
17 uint8 xdata InP20=0,InP21=0,InP22=0,InP23=0,InP24=0,InP25=0;
18 /**************************************************************************************/
19 bit M0=1,M1=1,M2=1,M3=1,M4=1,M5=1,M6=1,M7=1; //
20 bit M10=1,M11=1,M12=1,M13=1,M14=1,M15=1,M16=1,M17=1;
21 bit M20=1,M21=1,M22=1,M23=1,M24=1,M25=1,M26=1,M27=1;
22 bit M30=1,M31=1,M32=1,M33=1,M34=1,M35=1,M36=1,M37=1;
23 /**************************************************************************************/
24 bit T0_K=1,T1_K=1,T2_K=1,T3_K=1,T4_K=1,T5_K=1,T6_K=1,T7_K=1;
25 bit T10_K=1,T11_K=1;//,TK12_bit=1,TK13_bit=1,TK14_bit=1,TK15_bit=1,TK16_bit=1,TK17_bit=1;
26 /**************************************************************************************/
27 bit T0_bit=1,T1_bit=1,T2_bit=1,T3_bit=1,T4_bit=1,T5_bit=1,T6_bit=1,T7_bit=1;
28 //bit TC10_bit=1,TC11_bit=1,TC12_bit=1,TC13_bit=1,TC14_bit1,TC15_bit=1,TC16_bit=1,TC17_bit=1;
29 /**************************************************************************************/
30 uint16 xdata T0K =0;
31 uint16 xdata T1K =0;
32 uint16 xdata T2K =0;
33 uint16 xdata T3K =0;
34 uint16 xdata T4K =0;
35 uint16 xdata T5K =0;
36 uint16 xdata T6K =0;
37 uint16 xdata T7K =0;
38
39 uint16 xdata T10K=0;
40 uint16 xdata T11K=0;
41
42 /* P2 */
43 sbit XX17 = 0xA0;
44 sbit XX20 = 0xA1;
45 sbit XX21 = 0xA2;
46 sbit XX22 = 0xA3;
47 sbit XX23 = 0xA4;
48 sbit XX24 = 0xA5;
49 sbit XX25 = 0xA6;
50 /********P1*********/
51 sbit XX0 = 0x90;
52 sbit XX1 = 0x91;
53 sbit XX2 = 0x92;
54 sbit XX3 = 0x93;
C51 COMPILER V8.16 IO_CHECK 01/30/2009 21:42:47 PAGE 2
55 sbit XX4 = 0x94;
56 sbit XX5 = 0x95;
57 sbit XX6 = 0x96;
58 sbit XX7 = 0x97;
59 /********P3*********/
60 sbit XX11 = 0xB0;
61 sbit XX10 = 0xB1;
62 sbit XX14 = 0xB2;
63 sbit XX12 = 0xB4;
64 sbit XX13 = 0xB5;
65 sbit XX15 = 0xB6;
66 sbit XX16 = 0xB7;
67 /***************************************************************/
68 //PLC输入消抖
69 void check_IO(void)
70 {
71 1 //**********X0******************
72 1 if( XX0==0)
73 1 {
74 2 if(InP0>=TSS1){if( XX0==0){ X0=0;InP0=0;}}else InP0++;
75 2 }else (X0 = 1,InP0=0);
76 1 //**********X1******************
77 1 if( XX1==0)
78 1 {
79 2 if(InP1>=TSS1){if( XX1==0){ X1=0;InP1=0;}}else InP1++;
80 2 }else (X1 = 1,InP1=0);
81 1 //**********X2******************
82 1 if( XX2==0)
83 1 {
84 2 if(InP2>=TSS1){if( XX2==0){ X2=0;InP2=0;}}else InP2++;
85 2 }else (X2 = 1,InP2=0);
86 1 //**********X3******************
87 1 if( XX3==0)
88 1 {
89 2 if(InP3>=TSS1){if( XX3==0){ X3=0;InP3=0;}}else InP3++;
90 2 }else (X3 = 1,InP3=0);
91 1 //**********X4******************
92 1 if( XX4==0)
93 1 {
94 2 if(InP4>=TSS1){if( XX4==0){ X4=0;InP4=0;}}else InP4++;
95 2 }else (X4 = 1,InP4=0);
96 1 //**********X5******************
97 1 if( XX5==0)
98 1 {
99 2 if(InP5>=TSS1){if( XX5==0){ X5=0;InP5=0;}}else InP5++;
100 2 }else (X5 = 1,InP5=0);
101 1 //**********X6******************
102 1 if( XX6==0)
103 1 {
104 2 if(InP6>=TSS1){if( XX6==0){ X6=0;InP6=0;}}else InP6++;
105 2 }else (X6 = 1,InP6=0);
106 1 //**********X7******************
107 1 if( XX7==0)
108 1 {
109 2 if(InP7>=TSS1){if( XX7==0){ X7=0;InP7=0;}}else InP7++;
110 2 }else (X7 = 1,InP7=0);
111 1 //
112 1 //**********X10******************
113 1 if( XX10==0)
114 1 {
115 2 if(InP10>=TSS1){if( XX10==0){ X10=0;InP10=0;}}else InP10++;
116 2 }else (X10 = 1,InP10=0);
C51 COMPILER V8.16 IO_CHECK 01/30/2009 21:42:47 PAGE 3
117 1 //**********X11******************
118 1 if( XX11==0)
119 1 {
120 2 if(InP11>=TSS1){if( XX11==0){ X11=0;InP11=0;}}else InP11++;
121 2 }else (X11 = 1,InP11=0);
122 1 //**********X12******************
123 1 if( XX12==0)
124 1 {
125 2 if(InP12>=TSS1){if( XX12==0){ X12=0;InP12=0;}}else InP12++;
126 2 }else (X12 = 1,InP12=0);
127 1 //**********X13******************
128 1 if( XX13==0)
129 1 {
130 2 if(InP13>=TSS1){if( XX13==0){ X13=0;InP13=0;}}else InP13++;
131 2 }else (X13 = 1,InP13=0);
132 1 //**********X14******************
133 1 if( XX14==0)
134 1 {
135 2 if(InP14>=TSS1){if( XX14==0){ X14=0;InP14=0;}}else InP14++;
136 2 }else (X14 = 1,InP14=0);
137 1 //**********X15******************
138 1 if( XX15==0)
139 1 {
140 2 if(InP15>=TSS1){if( XX15==0){ X15=0;InP15=0;}}else InP15++;
141 2 }else (X15 = 1,InP15=0);
142 1 //**********X16******************
143 1 if( XX16==0)
144 1 {
145 2 if(InP16>=TSS1){if( XX16==0){ X16=0;InP16=0;}}else InP16++;
146 2 }else (X16 = 1,InP16=0);
147 1 //**********X17******************
148 1 if( XX17==0)
149 1 {
150 2 if(InP17>=TSS1){if( XX17==0){ X17=0;InP17=0;}}else InP17++;
151 2 }else (X17 = 1,InP17=0);
152 1 //
153 1 //**********X20******************
154 1 if( XX20==0)
155 1 {
156 2 if(InP20>=TSS1){if( XX20==0){ X20=0;InP20=0;}}else InP20++;
157 2 }else (X20 = 1,InP20=0);
158 1 //**********X21******************
159 1 if( XX21==0)
160 1 {
161 2 if(InP21>=TSS1){if( XX21==0){ X21=0;InP21=0;}}else InP21++;
162 2 }else (X21 = 1,InP21=0);
163 1 //**********X22******************
164 1 if( XX22==0)
165 1 {
166 2 if(InP22>=TSS1){if( XX22==0){ X22=0;InP22=0;}}else InP22++;
167 2 }else (X22 = 1,InP22=0);
168 1 //**********X23******************
169 1 if( XX23==0)
170 1 {
171 2 if(InP23>=TSS1){if( XX23==0){ X23=0;InP23=0;}}else InP23++;
172 2 }else (X23 = 1,InP23=0);
173 1 //**********X24******************
174 1 if( XX24==0)
175 1 {
176 2 if(InP24>=TSS1){if( XX24==0){ X24=0;InP24=0;}}else InP24++;
177 2 }else (X24 = 1,InP24=0);
178 1 //**********X25******************
C51 COMPILER V8.16 IO_CHECK 01/30/2009 21:42:47 PAGE 4
179 1 if( XX25==0)
180 1 {
181 2 if(InP25>=TSS1){if( XX25==0){ X25=0;InP25=0;}}else InP25++;
182 2 }else (X25 = 1,InP25=0);
183 1 }
184 /***************************************************************/
185 //端口初始化
186 void initFlag(void)
187 {
188 1 P0 = 0xFF; // 输出端口初始化
189 1 P2 = 0xFF; // 输出端口初始化
190 1 P1 = 0xFF; // 输入端口初始化
191 1 P3 = 0xFF; // 输入端口初始化
192 1 }
193 /*******************中断初始化**********************************/
194 //定时器中断初始化
195 void initTimer (void)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -