电熨斗程序(Electric iron program)
电熨斗程序(Electric iron program)
*************************************** Yihe electric iron *******************************************;
MDT Corp (SZ) Ltd;
;;
File:, K-105.ASM, Editor:, KEN, KONG;
;;
Date: 06 - 06 - 09 Ver: 1.3;
Integrated 8 minutes, 30 seconds, 10 minutes, 2 minutes, a total of 3 versions in a program; modify flash time for 1S, 1 lights, 1 out;
Type:, MDT10P53, INT_RC_OSC:, 4MHz;
The correction was reduced by 3 seconds, 8 minutes by 12s, and 10 by 15s;
To change the LED display output for the buzzer output
To change the output of the buzzer sound, 4 times a second, beep, sound 15s;
To change the output buzzer for active output, 1S 8 times beep, 125ms duty cycle
*******************************************************************************************;
LIST P=12C509;
-------------------FSR DEFINE--------------------;
*************************************************;
INDF, EQU, 00H;
TMR0 EQU 01H;
STATUS EQU 03H;
FSR, EQU, 04H;
PB EQU 06H;
*************************************************;
-----------------PORT DEFINE---------------------;
*************************************************;
BEEP_OUT EQU 5; buzzer control port
RL1_OUT EQU 4; relay control port
MODE_IN EQU 3; mode select switch
FOR TEST
MODE3_IN EQU 2; removable
LED_OUT EQU 5
GDS_IN EQU 1; touch bead status detection
RESTART_IN EQU 0; manual start key
*************************************************;
----------------REGISTER DEFINE------------------;
DELAY1 EQU 08H;
DELAY2 EQU 09H;
DELAYCK1S EQU 0AH;
GDS_STATUS EQU 0BH; touch bead input status memory
NEWSTATUS EQU 0; current status of contact bead
OLDSTATUS EQU 1; a previous state of contact with beads
STA_CHANGE EQU 2; status changes bit
BEEP_OTP EQU 3; beep enable flag bit
RUN_MODE EQU 5; running mode is divided into 10 minutes, 8
minutes, 2 minutes
RUN_MODE1 EQU 6; 10 minutes for 10, 8 minutes for 00, 2 minutes
for 01, a total of 3
CHECK_EN EQU 7; detection enable bits
CHECK_NUM EQU 0DH;
GDS_TEMP EQU 0EH; touch bead input level detection register
DELAY_SEC EQU 0FH
DELAY_NS EQU 10H
DELAY_3S EQU 11H
BEEP_TIME EQU 12H
TIME0 EQU 13H
H_LEVEL EQU 14H
L_LEVEL EQU 15H
*************************************************;
W EQU 0
F EQU 1
C EQU 0
Z EQU 2
*************************************************;
--------------------PROGRAMME
START------------------------;
*************************************************;
ORG 03FFH
GOTO START
*************************************************;
*************************************************;
程序如下:ORG 0000H
从新启动
;*************************************************
;初始化开始
开始
movlw B“00000 101”;64分频,64×256,16384us溢出判断为
8.192ms溢出一次。
选项
movlw B '00001111”;设置铅口
三铅
清除溢油的铅
movlw B '00100000”;此处放模式资料,为bit6bit5
;_8分钟/ 10分钟双功能为00,带哔功能为01,2分钟/ 2分钟为10,2分钟分钟为11 / 8
movwf gds_status;初始化GDS状态寄存器,检测使能为不使能
电话gds_check01s;为保证继电器正常工作,上电延迟1s
模式选择,直接跳转;
btfss gds_status,6
去mode8_10
mode2_2_8
btfss gds_status,5
去mode_2min2min
去mode_2min8min
mode8_10
btfss gds_status,5
去mode_8min10min
去mode_beep
;
***********************************************************
********************
;*************************************************;
-----------------------------端口初始化
---------------------------------------------;
;*************************************************;
;_2分/ 2分的程序开始
mode_2min2min:
movlw。39;2分钟平放立放均加热
去aso_out
嘟嘟模式开始;
mode_beep
movlw。20;1分钟一上电均加热
1;movlw。
去aso_out
;*************************************************;
;_2分/ 8分的程序开始
mode_2min8min:
btfsc gds_status,0
去mode_2min8min_high;立放,延时8分,忽略检测GDS的变化
mode_2min8min_low:
movlw。39;GDS为低,平放加热120s(2分)
去aso_out
mode_2min8min_high:
movlw。156;GDS为高,立放加热8分钟
6 movlw;试验。
去aso_out
mode_8min10min
NOP
;*************************************************;
;_8分/ 30秒的程序开始
mode_8min:
btfsc gds_status,0
去mode_8min_high;立放,延时8分,忽略检测GDS的变化
mode_8min_low:
movlw。30;GDS为低,平放加热90s(1分30s)
;测试
20;movlw。
去aso_out
mode_8min_high:
;movlw。160;GDS为高,立放加热8分钟
movlw。156;修正值,9s
;测试
40;movlw。
去aso_out
;*************************************************;
;加热延时检测主程序
aso_out:
movwf delay_ns
BCF Pb、beep_out;加热动作开始
;BCF Pb、led_out
BSF Pb、rl1_out
电话gds_check1s;
BCF gds_status,2
清除溢油时间
delay_3s_lp:
movlw。3;延时3S,因1个检测周期是1s
movwf delay_3s
delay_s_lp:
BSF Pb、rl1_out
delay_s_lp_1
电话gds_checkin
去delay_s_lp_1
time1s_out
小delay_3s,F;
Delay 3S time to no
GOTO DELAY_S_LP
DECFSZ, DELAY_NS, F; total heating delay time
GOTO DELAY_3S_LP
GOTO ASO_IN; to, turn ASO_IN, stop heating treatment
***********************************************************
*******;
Test input subroutine
GDS_CHECKIN
CLRF L_LEVEL
CLRF H_LEVEL
GDS_CHECKIN_LP
BTFSC, GDS_STATUS, 2; judge whether the status change bit is
1
GOTO STATUS_CHANGE; change to status; change handler
CLRWDT
BTFSC TMR0,7
GOTO TMR0_OUT
GOTO GDS_CHECKIN_LP
CHECK_IT
BTFSS GDS_STATUS, 7
GOTO GDS_CHECKIN_LP
BTFSS, PB, GDS_IN
GOTO GDS_LOW_IN
GDS_HIGH_IN
BTFSC GDS_STATUS, 1
GOTO GDS_CHECKIN_LP; the original is high, the input is high,
and the direct exit
CLRF L_LEVEL
INCF, H_LEVEL, F
BTFSS, H_LEVEL, 3; sensitivity changes the number of digits to
change sensitivity
GOTO GDS_CHECKIN_LP
CLRF H_LEVEL
BSF GDS_STATUS, 1
BSF GDS_STATUS, 2
GOTO GDS_CHECKIN_LP
GDS_LOW_IN
BTFSS GDS_STATUS, 1
GOTO GDS_CHECKIN_LP; the original is low and the input is low,
too
CLRF H_LEVEL
INCF, L_LEVEL, F
BTFSS, L_LEVEL, 3; sensitivity changes the number of digits to
change sensitivity
GOTO GDS_CHECKIN_LP
CLRF L_LEVEL
BCF GDS_STATUS, 1
BSF GDS_STATUS, 2
GOTO GDS_CHECKIN_LP
TMR0_OUT
BCF TMR0,7
INCF, TIME0, F
BTFSS TIME0,7
GOTO CHECK_IT
MOVLW B'10000110'
ADDWF, TIME0, F
GOTO TIME1S_OUT
*************************************************;
Protect ASO from running
ASO_IN:
MOVLW.10
MOVLW.40
MOVWF BEEP_TIME
ASO_IN_F1
MOVLW 20H; ASO open, LED state turns 1 times per second
XORWF, PB, F
BCF, PB, RL1_OUT; ASO open
CALL GDS_CHECK125MS_BEEP
BTFSC, GDS_STATUS, 2; judge whether the status change bit is 1
GOTO STATUS_CHANGE; change to status; change handler
CALL GDS_CHECK125MS
BTFSC, GDS_STATUS, 2; judge whether the status change bit is 1
GOTO STATUS_CHANGE; change to status; change handler
DECFSZ, BEEP_TIME, F; total heating delay time
GOTO ASO_IN_F1
ASO_IN_FORE
BCF, PB, RL1_OUT
BCF, GDS_STATUS, 7; open relay, time delay 1s detection, in case of misoperation
CALL GDS_CHECK1S
ASOIN_1:
BCF, PB, RL1_OUT; ASO open
BCF, PB, BEEP_OUT
BSF, GDS_STATUS, 7; detection enable
ASOIN_1_1
MOVLW 20H; ASO open, LED state turns 1 times per second
XORWF, PB, F
CALL GDS_CHECK1S; delayed 1 second and detected changes in GDS
status
BTFSC, GDS_STATUS, 2; judge whether the status change bit is 1
GOTO STATUS_CHANGE; change to status; change handler
GOTO ASOIN_1_1; repeat the ASO_IN action for 0
*************************************************;
Status change handler
STATUS_CHANGE:
BTFSS GDS_STATUS, 0
GOTO GDS_TOLOW
GOTO GDS_TOHIGH
GDS_TOLOW: MOVLW.10; GDS is low, flat heating 30s
GOTO ASO_OUT
GDS_TOHIGH: MOVLW.156; GDS is high, stand up and heat for 8 minutes
GOTO ASO_OUT
*************************************************;
GDS level change detection subroutine 1S
GDS_CHECK1S:
MOVLW.8
MOVWF DELAYCK1S
GOTO GDS_CHECK_START
GDS_CHECK01S:
MOVLW.1
MOVWF DELAYCK1S
GOTO GDS_CHECK_START
GDS level change detection subroutine 05S
GDS_CHECK05S:
MOVLW.6
MOVLW.1
MOVWF DELAYCK1S
GDS_CHECK_START:; GDS level change detection subroutine 250MS
MOVLW 08H
MOVWF GDS_TEMP
BCF GDS_STATUS, 0; GDS; the current status is pre cleared 0
MOVLW 7H; detected 7 times, a total of 125ms
MOVWF CHECK_NUM; change sensitivity, and change GDS_TEMP
GDS_CHECK_LP:
BTFSS, PB, GDS_IN
DECF, GDS_TEMP, F
BTFSC, PB, GDS_IN
INCF, GDS_TEMP, F
CALL DELAY18MS
DECFSZ, CHECK_NUM, F
GOTO GDS_CHECK_LP
MOVLW 08H
SUBWF GDS_TEMP, 0
BTFSC, STATUS, C
BSF GDS_STATUS, 0; get current status of GDS
BTFSS, GDS_STATUS, 0; have the judgment changed?
GOTO GDS_S_L; set the GDS status change bit
BTFSS GDS_STATUS, 1
BSF GDS_STATUS, 2
BTFSC GDS_STATUS, 1
BCF GDS_STATUS, 2
GOTO $+5
GDS_S_L:, BTFSC, GDS_STATUS, 1
BSF GDS_STATUS, 2
BTFSS GDS_STATUS, 1
BCF GDS_STATUS, 2
BTFSS, GDS_STATUS, 2; change of state
GOTO $+3; saves the current state to oldstatus
MOVLW 2H
XORWF, GDS_STATUS, F
BTFSS, GDS_STATUS, 7; judge change status, enable bit
BCF GDS_STATUS, 2; for 0, no enable, status change, bit clear
0
BTFSC GDS_STATUS, 2
GOTO $+3
DECFSZ, DELAYCK1S, F
GOTO GDS_CHECK_START
RETLW 0H; returns
*************************************************;
DELAY18MS:; delayed 18ms subroutine
MOVLW 0EH
MOVWF DELAY1
DELAY1_LP: MOVLW 0FEH
MOVWF DELAY2
NOP
DELAY2_LP: NOP
CLRWDT
DECFSZ, DELAY2, F
GOTO DELAY2_LP
DECFSZ, DELAY1, F
GOTO DELAY1_LP
RETLW 0H
*************************************************;
GDS_CHECK125MS
BCF, GDS_STATUS, BEEP_OTP
GOTO $+2
GDS_CHECK05S_BEEP
GDS_CHECK125MS_BEEP
BSF, GDS_STATUS, BEEP_OTP
MOVLW.5
MOVWF DELAYCK1S
CHECK1S_BEEP_START:
MOVLW 08H
MOVWF GDS_TEMP
BCF GDS_STATUS, 0; GDS; the current status is pre cleared 0
MOVLW 7H; detected 7 times, a total of 125ms
MOVWF CHECK_NUM; change sensitivity, and change GDS_TEMP
CHECK1S_BEEP_LP:
BTFSS, PB, GDS_IN
DECF, GDS_TEMP, F
BTFSC, PB, GDS_IN
INCF, GDS_TEMP, F
CALL DELAY18MS_BEEP
DECFSZ, CHECK_NUM, F
GOTO CHECK1S_BEEP_LP
MOVLW 08H
SUBWF GDS_TEMP, 0
BTFSC, STATUS, C
BSF GDS_STATUS, 0; get current status of GDS
BTFSS, GDS_STATUS, 0; have the judgment changed?
GOTO CHECK1S_BEEP_L; set the GDS status change bit
BTFSS GDS_STATUS, 1
BSF GDS_STATUS, 2
BTFSC GDS_STATUS, 1
BCF GDS_STATUS, 2
GOTO $+5
CHECK1S_BEEP_L:
BTFSC GDS_STATUS, 1
BSF GDS_STATUS, 2
BTFSS GDS_STATUS, 1
BCF GDS_STATUS, 2
BTFSS, GDS_STATUS, 2; change of state
GOTO $+3; saves the current state to oldstatus
MOVLW 2H
XORWF, GDS_STATUS, F
BTFSS, GDS_STATUS, 7; judge change status, enable bit
BCF GDS_STATUS, 2; for 0, no enable, status change, bit clear
0
BTFSC GDS_STATUS, 2
GOTO $+3
DECFSZ, DELAYCK1S, F
GOTO CHECK1S_BEEP_START
BCF, PB, BEEP_OUT
RETLW 0H; returns
*************************************************;
DELAY18MS_BEEP:; delayed 18ms subroutine
MOVLW 0EH
MOVLW 05H
MOVWF DELAY1
DELAY18MS_BEEP_LP: MOVLW 04DH
MOVWF DELAY2
DELAY18MS_BEE2_LP: NOP
BTFSS TMR0,1
BCF, PB, BEEP_OUT
BTFSC TMR0,1
BTFSS, GDS_STATUS, BEEP_OTP
BCF, PB, BEEP_OUT
BTFSC, GDS_STATUS, BEEP_OTP
BSF, PB, BEEP_OUT
CLRWDT
DECFSZ, DELAY2, F
GOTO DELAY18MS_BEE2_LP
DECFSZ, DELAY1, F
GOTO DELAY18MS_BEEP_LP
RETLW 0H
*************************************************;
*************************************************;
_10 start of the program
MODE_10MIN:
BSF, GDS_STATUS, 7; detection enable
GOTO MIN10_ASO_OUT
*************************************************;
Heating delay detection main program
MIN10_ASO_OUT:
MOVLW.195; flat, upright and heated for 10 minutes
MOVWF DELAY_NS
BSF, PB, LED_OUT; the heating action begins
BSF, PB, RL1_OUT
MIN10_3S_LP:
MOVLW.3; delay 3S, because the 1 detection cycle is 1s
MOVWF DELAY_3S
MIN10_S_LP:
CALL GDS_CHECK1S
BTFSC, GDS_STATUS, 2; judge whether the status change bit is 1
GOTO MIN10_ASO_OUT; change to ASO handler
DECFSZ, DELAY_3S, F; time delay, 30s, or not
GOTO MIN10_S_LP
DECFSZ, DELAY_NS, F; total heating delay time
GOTO MIN10_3S_LP
GOTO MIN10_ASO_IN; to, turn ASO_IN, stop heating treatment
*************************************************;
Protect ASO from running
MIN10_ASO_IN:
BCF, PB, LED_OUT; start of heating action
BCF, PB, RL1_OUT; ASO open
BCF, GDS_STATUS, 7; open relay, time delay 1s detection, in case of misoperation
CALL GDS_CHECK1S
MIN10_ASOIN_1:
BSF, GDS_STATUS, 7; detection enable
CLRWDT
BTFSC, PB, RESTART_IN
GOTO $-2
GOTO MIN10_ASO_OUT; ASO_out action
*************************************************;
END
--------------------PROGRAMME END------------------------;
;
**************************************************************************************************;
本文档为【电熨斗程序(Electric iron program)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。