📄 detect.lst
字号:
203 000000 bset ADCstartflag
204 000000 mov a,#04h
205 000000 mov p4con,a ;isolate an2
206 000000 mov a,#02h
207 000000 mov adm,a ;enable an2
208 000000 mov_ var1,#4
209 000000 clr ADCvaluel
210 000000 clr ADCvalueh
211 000000 ;-----
212 000000 cookertempdetect60:
213 000000 call mnADconvert
214 000000 ret
215 000000 ;-----
216 000000 ;取出AD值,进行比较
217 000000 cookertempdetect70:
218 000000 ;-----
219 000000 bset volADCflag
220 000000 bclr curADCflag
221 000000 bclr IgbtADCflag
222 000000 bclr cookerADCflag
223 000000 bclr ADCstartflag
224 000000 bclr ADCendflag
225 000000 ;-----
226 000000 ;温度传感器开、短路分析
227 000000 call sensoranalyse
228 000000 ;-----
229 000000 b0bts0 malfunctionflag
230 000000 jmp cookertempdetect90
231 000000 ;-----
232 000000 ;过热分析
233 000000 call hotestanalyse
234 000000 ;-----
235 000000 b0bts0 malfunctionflag
236 000000 jmp cookertempdetect90
237 000000 ;-----
238 000000 ;温度控制
239 000000 b0bts0 overtempflag
240 000000 jmp cookertempdetect80
241 000000 ;-----
242 000000 mov_ temp0,ADCtempbufl
243 000000 mov_ temp1,ADCtempbufh
244 000000 ;-----
245 000000 mov a,ADCvaluel
246 000000 sub a,temp0
247 000000 mov a,ADCvalueh
248 000000 sbc a,temp1 ;ADCvalue-temp
249 000000 b0bts1 fc
250 000000 jmp cookertempdetect90 ;没有超温
251 000000 ;-----
252 000000 ;在哪一功能下
253 000000 mov a,flag3
254 000000 and a,#00011000b
255 000000 b0bts0 fz
256 000000 jmp stopheat
257 000000 b0bts1 fourthstepflag
258 000000 jmp cookertempdetect50
259 000000 ;-----------------------
260 000000 stopheat:
261 000000 bset overtempflag
262 000000 ;// bclr ptcout
263 000000 bclr fpwm1out
264 000000 bclr ftc1enb ;stop t1 pwm
265 000000 bclr ptpwm
266 000000 ret
267 000000 ;----------------------
268 000000 cookertempdetect50:
269 000000 bset tempcomeflag
270 000000 ret
271 000000 ;----------------------
272 000000 cookertempdetect80:
273 000000 ;-----
274 000000 mov_ temp0,ADCtempbufl ;超温后,温度往下降个10点再加热
275 000000 mov_ temp1,ADCtempbufh
276 000000 mov a,temp0
277 000000 sub a,#10
278 000000 mov temp0,a
279 000000 mov a,#0
280 000000 mov temp2,a
281 000000 mov a,temp1
282 000000 sbc a,temp2
283 000000 mov temp1,a
284 000000 ;-----
285 000000 mov a,ADCvaluel
286 000000 sub a,temp0
287 000000 mov a,ADCvalueh
288 000000 sbc a,temp1 ;ADCvalue-temp
289 000000 b0bts0 fc
290 000000 jmp cookertempdetect90
291 000000 ;---
292 000000 bclr overtempflag
293 000000 bclr Igbtstartupflag
294 000000 ;-----
295 000000 cookertempdetect90:
296 000000 ret
297 000000
298 000000 ;**********************************************
299 000000 ;Name :cookercheck
300 000000 ;Function:无锅具、锅具材料不合、小物件检测
301 000000 ;Input :
302 000000 ;Output :
303 000000 ;Register Used:var3,var4
304 000000 ;***********************************************
305 000000 cookercheck:
306 000000 ;-----
307 000000 b0bts0 stoprunflag
308 000000 jmp cookercheck90
309 000000 b0bts1 operateflag
310 000000 jmp cookercheck90
311 000000 b0bts0 malfunctionflag
312 000000 jmp cookercheck90 ;其他故障
313 000000 b0bts0 abnormalvoltfalg
314 000000 jmp cookercheck90 ;市电电压不正常
315 000000 b0bts0 checkcookerflag
316 000000 jmp cookercheck80
317 000000 b0bts0 detecttimeflag
318 000000 jmp cookercheck70
319 000000 ;------------------------
320 000000 bset detecttimeflag
321 000000 bclr checkingflag
322 000000 bclr havecookerflag
323 000000 bclr pulsetimeflag
324 000000 mov_ pulsetimer,#200 ;工作状态下,1秒钟检测一次
325 000000 mov_ timer20ms,#1
326 000000 ;------
327 000000 mov_ tc1r,#0ah ;发试探信号,检测锅
328 000000 bset fp01ien
329 000000 bset fpwm1out
330 000000 bset ftc1enb
331 000000 ret
332 000000 ;-----------------
333 000000 cookercheck70:
334 000000 mov a,timer20ms
335 000000 b0bts1 fz
336 000000 jmp cookercheck90
337 000000 ;----
338 000000 bset checkcookerflag
339 000000 bclr detecttimeflag
340 000000 bclr ADCstartflag
341 000000 bclr ADCendflag
342 000000 mov a,#02h
343 000000 mov p4con,a ;isolate an1
344 000000 mov a,#01h
345 000000 mov adm,a ;enable an1
346 000000 mov_ var1,#4
347 000000 clr ADCvaluel
348 000000 clr ADCvalueh
349 000000 call mnADconvert
350 000000 ;-----
351 000000 bclr ADCstartflag
352 000000 bclr ADCendflag
353 000000 mov_ var3,#ADCnocookerl
354 000000 mov_ var4,#ADCnocookerh
355 000000 ;-----
356 000000 ;比较参数
357 000000 mov a,ADCvaluel
358 000000 sub a,var3
359 000000 mov a,ADCvalueh
360 000000 sbc a,var4
361 000000 b0bts0 fc
362 000000 jmp havecookerdeal
363 000000 ;---------------
364 000000 ;无锅处理
365 000000 b0bts0 checktimeflag
366 000000 jmp checkingtime
367 000000 bset checktimeflag
368 000000 mov_ timer1m,#60
369 000000 bclr oneminuteflag
370 000000 bclr havecookerflag
371 000000 bclr ptcout ;close IGBT
372 000000 bclr fpwm1out
373 000000 bclr ftc1enb ;stop t1 pwm
374 000000 bclr fp01ien
375 000000 ;-----
376 000000 mov_ seg1buf,#Errorvalue
377 000000 mov_ seg2buf,#Errorvalue1
378 000000 bset nocookerflag
379 000000 bclr startflag
380 000000 ret
381 000000 ;------
382 000000 checkingtime:
383 000000 b0bts1 oneminuteflag
384 000000 jmp cookercheck60
385 000000 ;----
386 000000 bclr oneminuteflag
387 000000 bset stoprunflag
388 000000 bset buzzerflag
389 000000 mov_ buzzercnt,#120 ;蜂鸣器鸣叫一分钟后关机
390 000000 ;-----
391 000000 cookercheck60:
392 000000 ;// bclr ptcout ;close IGBT
393 000000 bclr fpwm1out
394 000000 bclr ftc1enb ;stop t1 pwm
395 000000 bclr ptpwm
396 000000 bclr fp01ien
397 000000 ret
398 000000 ;-----------------
399 000000 havecookerdeal:
400 000000 ;有锅处理
401 000000 bset havecookerflag
402 000000 bclr Igbtstartupflag
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -