📄 detect.lst
字号:
1 000000 ;******************************************************
2 000000 ;name:mndetect
3 000000 ;function:用于各种A/D检测的切换
4 000000 ;input:
5 000000 ;output:
6 000000 ;register:
7 000000 ;*******************************************************
8 000000 mndetect:
9 000000 jb1 stoprunflag,mndetect90
10 000000 jb0 havecookerflag,mndetect90 ;=1:锅符合,开始工作
11 000000 jb0 operateflag,mndetect90 ;工作状态下,开启检测
12 000000 jb1 volADCflag,voltagedetect ;电压检测
13 000000 jb1 abnormalvoltfalg,mndetect90 ;市电电压不正常退出检测
14 000000 jb1 curADCflag,currentdetect ;电流检测
15 000000 jb1 IgbtADCflag,Igbttempdetect ;IGBT温度检测
16 000000 jb1 cookerADCflag,cookertempdetect ;锅底温度检测
17 000000 ;-----
18 000000 ;强制纠错
19 000000 bset volADCflag
20 000000 bclr ADCstartflag
21 000000 bclr ADCendflag
22 000000 ;-----
23 000000 mndetect90:
24 000000 ret
25 000000
26 000000 ;******************************************************
27 000000 ;name:voltagedetect
28 000000 ;function:用于电压检测(包括市电电压过压、欠压检测)
29 000000 ;input:
30 000000 ;output:
31 000000 ;register:temp0,temp1
32 000000 ;*******************************************************
33 000000 voltagedetect:
34 000000 b0bts0 ADCendflag
35 000000 jmp voltagedetect80
36 000000 b0bts0 ADCstartflag
37 000000 jmp voltagedetect70
38 000000 ;-----
39 000000 bset ADCstartflag
40 000000 mov a,#01h
41 000000 mov p4con,a ;isolate an0
42 000000 mov a,#00h
43 000000 mov adm,a ;enable an0
44 000000 mov_ var1,#4
45 000000 clr ADCvaluel
46 000000 clr ADCvalueh
47 000000 ;-----
48 000000 voltagedetect70:
49 000000 call mnADconvert
50 000000 ret
51 000000 ;-------------------------
52 000000 ;取出AD值,进行比较
53 000000 voltagedetect80:
54 000000 ;-----
55 000000 mov_ ADCvolbufl,ADCvaluel
56 000000 mov_ ADCvolbufh,ADCvalueh ;push voltage ADC value
57 000000 ;-----
58 000000 bclr volADCflag
59 000000 bset curADCflag
60 000000 bclr IgbtADCflag
61 000000 bclr cookerADCflag
62 000000 bclr ADCstartflag
63 000000 bclr ADCendflag
64 000000 ;-----
65 000000 ;先市电电压过压、欠压检测
66 000000 call voltageanalyse
67 000000
68 000000 voltagedetect90:
69 000000 ret
70 000000
71 000000 ;******************************************************
72 000000 ;name:currentdetect
73 000000 ;function:用于检测负载电流
74 000000 ;input:
75 000000 ;output:
76 000000 ;register:temp0,temp1
77 000000 ;*******************************************************
78 000000 currentdetect:
79 000000 b0bts0 malfunctionflag
80 000000 jmp currentdetect90 ;有故障,退出
81 000000 b0bts0 ADCendflag
82 000000 jmp currentdetect80
83 000000 b0bts0 ADCstartflag
84 000000 jmp currentdetect70
85 000000 ;-----
86 000000 bset ADCstartflag
87 000000 mov a,#02h
88 000000 mov p4con,a ;isolate an1
89 000000 mov a,#01h
90 000000 mov adm,a ;enable an1
91 000000 mov_ var1,#4
92 000000 clr ADCvaluel
93 000000 clr ADCvalueh
94 000000 ;-----
95 000000 currentdetect70:
96 000000 call mnADconvert
97 000000 ret
98 000000 ;-------------------------------
99 000000 ;取出AD值,进行比较
100 000000 currentdetect80:
101 000000 ;-----
102 000000 mov_ ADCcurbufl,ADCvaluel
103 000000 mov_ ADCcurbufh,ADCvalueh
104 000000 ;-----
105 000000 bclr volADCflag
106 000000 bclr curADCflag
107 000000 bset IgbtADCflag
108 000000 bclr cookerADCflag
109 000000 bclr ADCstartflag
110 000000 bclr ADCendflag
111 000000 ;-----
112 000000 ;先过流检测
113 000000 call currentanalyse
114 000000 ;-----
115 000000 ;pwm脉宽调整(功率=ADCvolbufh,ADCvolbuflxADCcurbufh,ADCcurbufl)
116 000000 call ADC16x16bit
117 000000 call mnpwmpulseset
118 000000 ;-----
119 000000 currentdetect90:
120 000000 ret
121 000000
122 000000 ;******************************************************
123 000000 ;name:Igbttempdetect
124 000000 ;function:用于检测IGBT温度
125 000000 ;input:
126 000000 ;output:
127 000000 ;register:temp0,temp1
128 000000 ;*******************************************************
129 000000 Igbttempdetect:
130 000000 b0bts0 malfunctionflag
131 000000 jmp currentdetect90 ;有故障,退出
132 000000 b0bts0 ADCendflag
133 000000 jmp Igbttempdetect70
134 000000 b0bts0 ADCstartflag
135 000000 jmp Igbttempdetect60
136 000000 ;-----
137 000000 bset ADCstartflag
138 000000 mov a,#08h
139 000000 mov p4con,a ;isolate an3
140 000000 mov a,#03h
141 000000 mov adm,a ;enable an3
142 000000 mov_ var1,#4
143 000000 clr ADCvaluel
144 000000 clr ADCvalueh
145 000000 ;-----
146 000000 Igbttempdetect60:
147 000000 call mnADconvert
148 000000 ret
149 000000 ;-----
150 000000 ;取出AD值,进行比较
151 000000 Igbttempdetect70:
152 000000 ;-----
153 000000 bclr volADCflag
154 000000 bclr curADCflag
155 000000 bclr IgbtADCflag
156 000000 bset cookerADCflag
157 000000 bclr ADCstartflag
158 000000 bclr ADCendflag
159 000000 ;-----
160 000000 ;温度传感器开、短路分析
161 000000 call sensoranalyse
162 000000 ;-----
163 000000 b0bts0 malfunctionflag
164 000000 jmp Igbttempdetect90
165 000000 mov_ temp0,#ADCIGBTvalueL
166 000000 mov_ temp1,#ADCIGBTvalueH
167 000000 ;-----
168 000000 ;IGBT过热分析
169 000000 mov a,ADCvaluel
170 000000 sub a,temp0
171 000000 mov a,ADCvalueh
172 000000 sbc a,temp1 ;ADCvalue-temp
173 000000 b0bts1 fc
174 000000 jmp Igbttempdetect80 ;没有超温
175 000000 bset overtempflag
176 000000 ;-----
177 000000 mov_ seg2buf,#Errorvalue2
178 000000 mov_ seg1buf,#Errorvalue
179 000000 bset malfunctionflag
180 000000 ret
181 000000 ;-----
182 000000 Igbttempdetect80:
183 000000 bclr overtempflag
184 000000 ;-----
185 000000 Igbttempdetect90:
186 000000 ret
187 000000
188 000000 ;******************************************************
189 000000 ;name:cookertempdetect
190 000000 ;function:用于检测锅底的温度
191 000000 ;input:
192 000000 ;output:
193 000000 ;register:temp0,temp1
194 000000 ;*******************************************************
195 000000 cookertempdetect:
196 000000 b0bts0 malfunctionflag
197 000000 jmp currentdetect90 ;有故障,退出
198 000000 b0bts0 ADCendflag
199 000000 jmp cookertempdetect70
200 000000 b0bts0 ADCstartflag
201 000000 jmp cookertempdetect60
202 000000 ;-----
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -