⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 detect.lst

📁 应用松翰母体写的一款电磁炉
💻 LST
📖 第 1 页 / 共 2 页
字号:
     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	operateflag,mndetect90		;工作状态下,开启检测
    11  000000             	jb1	abnormalvoltfalg,mndetect80	;市电电压不正常只检测电压
    12  000000             	jb0	havecookerflag,mndetect90	;=1:锅符合,开始工作
    13  000000             	jb0	cyclestartflag,mndetect90	;=1:开始一个循环的检测
    14  000000             ;----
    15  000000             mndetect80:
    16  000000             	jb1	volADCflag,voltagedetect    	;电压检测
    17  000000             	jb1	abnormalvoltfalg,mndetect90	;市电电压不正常退出检测
    18  000000             	jb1	curADCflag,currentdetect    	;电流检测 
    19  000000             	jb1	IgbtADCflag,Igbttempdetect  	;IGBT温度检测 
    20  000000             	jb1	cookerADCflag,cookertempdetect	;锅底温度检测
    21  000000             ;-----
    22  000000             ;强制纠错
    23  000000             	bset	volADCflag
    24  000000             	bclr	ADCstartflag
    25  000000             	bclr	ADCendflag
    26  000000             ;-----
    27  000000             mndetect90:
    28  000000             	ret
    29  000000             
    30  000000             ;******************************************************
    31  000000             ;name:voltagedetect
    32  000000             ;function:用于电压检测(包括市电电压过压、欠压检测)
    33  000000             ;input:
    34  000000             ;output:
    35  000000             ;register:temp0,temp1
    36  000000             ;*******************************************************
    37  000000             voltagedetect:
    38  000000             	b0bts0	malfunctionflag
    39  000000             	jmp	voltagedetect90	;有故障,退出
    40  000000             	b0bts0	ADCendflag
    41  000000             	jmp	voltagedetect80
    42  000000             	b0bts0	ADCstartflag
    43  000000             	jmp	voltagedetect70
    44  000000             ;-----
    45  000000             	bset	ADCstartflag
    46  000000             	mov	a,#01h
    47  000000             	mov	p4con,a		;isolate an0
    48  000000             	mov	a,#00h
    49  000000             	mov	adm,a		;enable an0
    50  000000             	mov_	ADCcnt,#4	
    51  000000             	clr	ADCvaluel
    52  000000             	clr	ADCvalueh
    53  000000             ;-----
    54  000000             voltagedetect70:
    55  000000             	call	mnADconvert
    56  000000             	ret
    57  000000             ;-------------------------
    58  000000             ;取出AD值,进行比较
    59  000000             voltagedetect80:
    60  000000             ;-----
    61  000000             	mov	a,ADCvaluel
    62  000000             	and	a,#0f0h
    63  000000             	mov	ADCvolbufl,a
    64  000000             	mov_	ADCvolbufh,ADCvalueh	;push voltage ADC value
    65  000000             ;-----
    66  000000             	bclr	volADCflag
    67  000000             	bset	curADCflag
    68  000000             	bclr	IgbtADCflag
    69  000000             	bclr	cookerADCflag
    70  000000             	bclr	ADCstartflag
    71  000000             	bclr	ADCendflag
    72  000000             	bclr	secondflag
    73  000000             ;-----
    74  000000             ;先市电过压、欠压检测
    75  000000             	call	voltageanalyse
    76  000000             
    77  000000             voltagedetect90:
    78  000000             	ret
    79  000000             	
    80  000000             ;******************************************************
    81  000000             ;name:currentdetect
    82  000000             ;function:用于检测负载电流
    83  000000             ;input:
    84  000000             ;output:
    85  000000             ;register:temp0,temp1
    86  000000             ;*******************************************************
    87  000000             currentdetect:
    88  000000             	b0bts0	malfunctionflag
    89  000000             	jmp	currentdetect90	;有故障,退出
    90  000000             	b0bts0	ADCendflag
    91  000000             	jmp	currentdetect80
    92  000000             	b0bts0	ADCstartflag
    93  000000             	jmp	currentdetect70
    94  000000             ;-----
    95  000000             	bset	ADCstartflag
    96  000000             	mov	a,#02h
    97  000000             	mov	p4con,a		;isolate an1
    98  000000             	mov	a,#01h
    99  000000             	mov	adm,a		;enable an1
   100  000000             	mov_	ADCcnt,#4	
   101  000000             	clr	ADCvaluel
   102  000000             	clr	ADCvalueh
   103  000000             ;-----
   104  000000             currentdetect70:
   105  000000             	call	mnADconvert
   106  000000             	ret
   107  000000             ;-------------------------------
   108  000000             ;取出AD值,进行比较
   109  000000             currentdetect80:
   110  000000             ;-----
   111  000000             	mov	a,ADCvaluel
   112  000000             	and	a,#0f0h
   113  000000             	mov	ADCcurbufl,a
   114  000000             	mov_	ADCcurbufh,ADCvalueh
   115  000000             ;-----
   116  000000             	bclr	volADCflag
   117  000000             	bclr	curADCflag
   118  000000             	bset	IgbtADCflag
   119  000000             	bclr	cookerADCflag
   120  000000             	bclr	ADCstartflag
   121  000000             	bclr	ADCendflag
   122  000000             ;-----
   123  000000             ;先过流检测
   124  000000             	call	currentanalyse
   125  000000             ;-----
   126  000000             ;pwm脉宽调整(功率P=U*I转化为
   127  000000             ;功率P=ADCvolbufh,ADCvolbuflxADCcurbufh,ADCcurbufl)
   128  000000             	call	ADC16x16bit
   129  000000             	call	mnpwmpulseset	
   130  000000             ;-----
   131  000000             currentdetect90:
   132  000000             	ret
   133  000000             	
   134  000000             ;******************************************************
   135  000000             ;name:Igbttempdetect
   136  000000             ;function:用于检测IGBT温度
   137  000000             ;input:
   138  000000             ;output:
   139  000000             ;register:temp0,temp1
   140  000000             ;*******************************************************
   141  000000             Igbttempdetect:
   142  000000             	b0bts0	malfunctionflag
   143  000000             	jmp	currentdetect90	;有故障,退出
   144  000000             	b0bts0	ADCendflag
   145  000000             	jmp	Igbttempdetect70
   146  000000             	b0bts0	ADCstartflag
   147  000000             	jmp	Igbttempdetect60
   148  000000             ;-----
   149  000000             	bset	ADCstartflag
   150  000000             	mov	a,#08h
   151  000000             	mov	p4con,a		;isolate an3
   152  000000             	mov	a,#03h
   153  000000             	mov	adm,a		;enable an3
   154  000000             	mov_	ADCcnt,#4	
   155  000000             	clr	ADCvaluel
   156  000000             	clr	ADCvalueh
   157  000000             ;-----
   158  000000             Igbttempdetect60:
   159  000000             	call	mnADconvert
   160  000000             	ret
   161  000000             ;-----
   162  000000             ;取出AD值,进行比较
   163  000000             Igbttempdetect70:
   164  000000             ;-----
   165  000000             	bclr	volADCflag
   166  000000             	bclr	curADCflag
   167  000000             	bclr	IgbtADCflag
   168  000000             	bset	cookerADCflag
   169  000000             	bclr	ADCstartflag
   170  000000             	bclr	ADCendflag
   171  000000             ;-----
   172  000000             ;温度传感器开、短路分析
   173  000000             	call	sensoranalyse
   174  000000             ;-----
   175  000000             	b0bts0	malfunctionflag
   176  000000             	jmp	Igbttempdetect90
   177  000000             	mov_	temp0,#ADCIGBTvalueL
   178  000000             	mov_	temp1,#ADCIGBTvalueH
   179  000000             ;-----
   180  000000             ;IGBT过热分析
   181  000000             	mov	a,ADCvaluel
   182  000000             	sub	a,temp0
   183  000000             	mov	a,ADCvalueh
   184  000000             	sbc	a,temp1		 ;ADCvalue-temp
   185  000000             	b0bts1	fc
   186  000000             	jmp	Igbttempdetect90 ;没有超温
   187  000000             ;-----
   188  000000             	mov_	seg2buf,#Errorvalue2
   189  000000             	mov_	seg1buf,#Errorvalue
   190  000000             	bset	malfunctionflag
   191  000000             ;-----
   192  000000             Igbttempdetect90:
   193  000000             	ret
   194  000000             	
   195  000000             ;******************************************************
   196  000000             ;name:cookertempdetect
   197  000000             ;function:用于检测锅底的温度
   198  000000             ;input:
   199  000000             ;output:
   200  000000             ;register:temp0,temp1

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -