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

📄 emctx808moo.dt

📁 这是一个有减肥功能的腰带按摩器
💻 DT
📖 第 1 页 / 共 3 页
字号:
clr        FlagSeg
;
bs         Flag10,BellBit
bs         Flag20,LoosenKeyBit
bs         Flag10,Key3sLoosenBit
eni
ret
;========================================
/*----------------------------------------

         Key result list
         
----------------------------------------*/
;****************************************
qiangdu:
tbl
retl       @00000001b
retl       @00000011b
retl       @00000111b
retl       @00001111b
retl       @00011111b
;========================================
HandTable:
tbl
retl		@CHandT1_0
retl   	 @CHandT1_1
;retl   	 @CHandT1_2
retl    	@CHandT1_3
retl        @CHandT1_4
;retl    	@CHandT1_5
retl   	 @CHandT1_6
;==========================================
;Yes, do with Key 
KeyScanYes00:
djz         RegWaitTime                       ;去抖动
jmp         MainLoop 
mov         a,@CWaitTime
mov         RegWaitTime,a
;disi
; 
bs         p7,EL                             ;有键按EL亮
bs         Flag20,LoosenKeyBit               ;按键没放标志             
;
bc         Flag00,TRelay100msBit      
bc         Flag00,TBell100msBit     
bc         Flag00,TMode100msBit  
bc         Flag10,TKey100msBit  
;
mov        a,@CKey3sOn                 ;define +/- Key power on time Register
mov        RegKey3sOn,a 
;
clr        RegKeyValue                 ;按键值寄存器
mov        a,p5
mov        RegKeyResult,a

Loop:
bs         status,c                    ;读按键值程序
rrc        RegKeyResult
jbs        status,c
jmp        KeyCompare00
;
inc        RegKeyvalue
mov        a,RegKeyValue
xor        a,@0x06
jbs        status,z
jmp        Loop
;eni
jmp        LoosenKeyWait00
;========================================
KeyCompare00:
;disi
bc          status,z
;-----------------------------------------
key00:      ;Power Key                           开机键处理
mov     	a, RegKeyValue
xor    	 a,@0x00
jbs    	 status,z
jmp    	 key01
;
bs          Flag10,BellBit       ;Bell Flag Bit ==1   蜂鸣器叫标志位
;
mov	     a,Flag00
xor	     a,@10000000b                             ;开机标志取反
mov         Flag00,a
;==CPL	  Flag00,WorkBit       ;
jbs	     Flag00,WorkBit
jmp     	key00_PowerOff
;
key00_PowerOn:
mov         a,@10
mov         time_10,a
mov         a,@0x01
mov         time_shi,a
mov         a,@0x0a
mov         time_ge,a
jmp         key00PowerOn 
;jmp     	LoosenKeyWait00
key00_PowerOff:

bc	  	Flag00,WorkBit  
;close all OUTPUT
call        MainIniti
bs          Flag10,BellBit       ;Bell Flag Bit ==1
jmp     	LoosenKeyWait00
;========================================
key01:   ;HI  Key                   ;增速键
mov    	 a, RegKeyValue
xor     	a,@0x01
jbs     	status,z
jmp    	 key02
;
jbs	     Flag00,WorkBit       ;workBit == 1? 
jmp    	 LoosenKeyWait00      ;no,return
;                                ;yes,
jbc         Flag10,ModeHandBit   ;MODE / HAND Exchange Bit自动模式标志。
jmp    	 key05_03             ;no,return /go to MODE
;                                ;yes,
jbc         Flag10,BellBit       ;judge BellBit==0
jmp    	 LoosenKeyWait00      ;no,return
                                 ;yes,
bs          Flag10,BellBit       ;Bell Flag Bit ==1
bc	      status,z
mov     	a,RegHandSCount      
xor	 	a,@0x04
jbc	 	status,z
jmp     	key01_01
;
key01_00:
inc		 RegHandSCount                      ;按键次数记忆标志
mov    	 a,RegHandSCount
call		HandTable
nop
nop
mov         RegT1,a
mov         RegT1Buff,a
mov         a,RegHandSCount
call        qiangdu                          ;增速LCD显示
nop
nop
mov         flagseg01,a
jmp    	 LoosenKeyWait00

key01_01:   ;(RegHandSCount)==4, close BEll Bit
bc          Flag10,BellBit    
jmp    	 LoosenKeyWait00     
;========================================
key02:   ;Lo  Key                             ;减速键
mov    	 a, RegKeyValue
xor    	 a,@0x02
jbs     	status,z
jmp    	 key03
;
jbs	     Flag00,WorkBit       ;workBit == 1? 
jmp    	 LoosenKeyWait00      ;no,return
;                                ;yes,
jbc         Flag10,ModeHandBit   ;MODE / HAND Exchange Bit
jmp    	 key05_03             ;no,return /go to MODE
;                                ;yes,
jbc         Flag10,BellBit       ;judge BellBit==0
jmp    	 LoosenKeyWait00      ;no,return
                                 ;yes,
bs          Flag10,BellBit       ;Bell Flag Bit ==1
;
bc	      status,z
mov    	 a,RegHandSCount
xor	 	a,@0x00              ;(RegHandSCount)==0?减完了再按无效
jbc		 status,z         
jmp     	key02_01             ;yes 
Key02_00:
dec	 	RegHandSCount        ;no
mov     	a,RegHandSCount
call		HandTable
nop
nop
mov         RegT1,a
mov         RegT1Buff,a
mov         a,RegHandSCount
call        qiangdu              ;减速LCD显示
mov         flagseg01,a       
jmp    	 LoosenKeyWait00
key02_01:   ;(RegHandSCount)==0, close BEll Bit
bc          Flag10,BellBit    
jmp    	 LoosenKeyWait00
;========================================
key03:     ;Forward Key            正反转切换键
mov    	a,RegKeyValue
xor    	a,@0x03
jbs    	status,z
jmp   	 key04
;
jbs	    Flag00,WorkBit        ;workBit == 1? 
jmp    	LoosenKeyWait00       ;no,return
;                                ;yes
jbc        Flag10,FitForBit      ;Fitness/ Forward KEY exchange Bit ==1?
jmp    	LoosenKeyWait00       ;yes,return
;                                ;no
bc         p5,Motor              ;close MOTOR
jbs        Flag00,TRelay1sBit    ;Relay Exchange finish ? 
jmp   	 key03_01              ;yes,redo
Key03_00:   
bc         Flag10,BellBit        ;No. Return ,close Bell Bit
bc         Flag00,TRelay1sBit    ;PWM OUTPUT Bit accept  after Forward
jmp   	 LoosenKeyWait00       ;Relay exchange finish, TRelay1sBit == 0
;
Key03_01:
bs         Flag00,TRelay1sBit    ;PWM OUTPUT Bit accept  after Forward
bc	     p5,MOTOR              ;stop MOTOR
bs         Flag10,BellBit        ;Bell Flag Bit ==1
;
jbc         Flag10,ModeHandBit   ;MODE / HAND Exchange Bit==1?
jmp    	 LoosenKeyWait00      ;yes,return /go to MODE
;
;mov	    a,@CHandT1_0          ;jump to the best low speed
;mov        RegT1,a
;mov        RegT1Buff,a
;mov        a,@0x00               ;count hand Reg. reset
;mov        RegHandSCount,a 
;
jmp   	  LoosenKeyWait00
;========================================
key04:  ;work time select key         时间模式键
mov   	  a, RegKeyValue
xor   	  a,@0x05
jbs   	  status,z
jmp   	  key05
;
jbs	     Flag00,WorkBit      ;workBit == 1? 
jmp    	 LoosenKeyWait00     ;no,return
;                               ;yes,
bs          Flag10,BellBit      ;Bell Flag Bit ==1
;----------------------------------------
jbs         time_x,xz_0
jmp         key04_T20mins
jbs         time_x,xz_1
jmp         key04_T30mins
jmp         key04_T10mins
;----------------------------------------
key04_T20mins:
bs          time_x,xz_0

mov         a,@0x02
mov         time_shi,a
mov         a,@0x0a
mov         time_ge,a
jmp    	 LoosenKeyWait00
;----------------------------------------
key04_T30mins:
bs          time_x,xz_1

mov         a,@0x03
mov         time_shi,a
mov         a,@0x0a
mov         time_ge,a
jmp    	 LoosenKeyWait00
key04_T10mins:
clr         time_x

mov         a,@0x01
mov         time_shi,a
mov         a,@0x0a
mov         time_ge,a
jmp    	 LoosenKeyWait00
;========================================
key05:  ;Mode / Hand work exchange key 自动模式三种状态切换键
mov    	a, RegKeyValue
xor    	a,@0x04
jbs    	status,z
jmp    	keyEnd
;
jbs	    Flag00,WorkBit     ;workBit == 1? 
jmp        LoosenKeyWait00    ;no,return
;                             ;yes,
key00PowerOn: 

call        Lcdks             ;调用开机lcd显示
nop
nop
clr         flagseg01                              ;Power Key open, jump to here, execute  the list           
bc         Flag10,FitForBit   ;Fitness/ Forward KEY exchange Bit ==0 / cancel it
bs         Flag10,BellBit     ;Bell Flag Bit ==1
bs         Flag10,ModeHandBit ;MODE / HAND Exchange Bit
bc         Flag00,TRelay1sBit  ;cancel Relay Auto-Exchange accept

inc        RegModeCount       ;go to MODE
;----------------------------------------
Key05_00:   ;Fitness Mode /slim & Trim
;Relay Auto-Exchange ,so (Flag00,TRelay1sBit) will set . 
mov        a,RegModeCount
xor        a,@0x01
jbs        status,z
jmp        Key05_01
bc         Flag20,ModeDetoxBit
bs         Flag20,ModeFitnessBit
bc         Flag20,ModeMassageBit
bs         Flag10,FitForBit       ;Fitness/ Forward KEY exchange Bit ==1
;
mov        a,@CModeT3s            ; CW / CWC for T3s set
mov        RegTModeCW,a
mov        RegTModeCWBuff,a
mov        a,@CModeT1s            ; stop for T1s set
mov        RegTModeStop,a
mov        RegTModeStopBuff,a
;
mov	    a,@CHandT1_3           ;Speed == No.4
mov        RegT1,a                ;in Fitness Mode
mov        RegT1Buff,a
mov        a,@00011001b
mov        flagseg11,a
;
jmp        Key05End
;---------------------------------------
Key05_01:   ;Detox Mode
mov        a,RegModeCount
xor        a,@0x02
jbs        status,z
jmp        Key05_02
bs         Flag20,ModeDetoxBit
bc         Flag20,ModeFitnessBit
bc         Flag20,ModeMassageBit
;
mov        a,@CModeT5s            ; CW / CWC for T5s set
mov        RegTModeCW,a
mov        RegTModeCWBuff,a
mov        a,@CModeT1s            ; stop for T1s set
mov        RegTModeStop,a
mov        RegTModeStopBuff,a
;                          
mov	    a,@CHandT1_3           ;Speed == No.4
mov        RegT1,a                ;in Detox Mode
mov        RegT1Buff,a
mov        a,@00001101b
mov        flagseg11,a
;
jmp        Key05End
;----------------------------------------
Key05_02:   ;Massage Mode
mov        a,RegModeCount
xor        a,@0x03
jbs        status,z
jmp        key05End00
;jmp        key05_03
bc         Flag20,ModeDetoxBit
bc         Flag20,ModeFitnessBit
bs         Flag20,ModeMassageBit
;
bc         Flag00,TRelay1sBit      ;cancel TRelay1sBit , Don't exchange Relay
;
clr        RegModeMC               ;clear RegModeMC
;
mov        a,@CSpeed0              ;
mov        RegT1,a                 ;
mov        RegT1Buff,a             ;PWM for 0
;
mov        a,@CModeTMa             ;Massage time set INC Constant 
mov        RegModeTMC,a
mov        RegModeTMCBuff,a
mov        a,@00001011b
mov        flagseg11,a
clr        RegHandSCount 
;
;jmp        Key05End
jmp        key05End00
;----------------------------------------
key05_03: ;exchange to Hand work

bs         Flag10,BellBit 
bc         Flag20,ModeDetoxBit
bc         Flag20,ModeFitnessBit
bc         Flag20,ModeMassageBit
mov         a,@0x02
mov         RegHandSCount,a
call        Lcdks           ;调用开LCD显示
nop
nop
nop
nop
mov         a,@00001001b
mov         flagseg11,a
clr         RegModeCount
bc         Flag10,FitForBit 
bc         Flag00,TRelay1sBit

bc         Flag10,ModeHandBit    
jmp         LoosenKeyWait00
key05End00:
    
clr        RegModeCount
;----------------------------------------
Key05End:
;jmp       LoosenKeyWait00
nop
;========================================
keyEnd:
clr    	RegKeyValue
jmp    	LoosenKeyWait00
;******************************************
;******************************************

org        02bch
;****************************************
/*----------------------------------------

         Main  list 
         
----------------------------------------*/
;******************************************
main:
;clearing memory list
mov    	a,@0x20
mov    	r4,a
again00:
clr    	r0
inc    	r4
mov    	a,r4
bc     	status,z
xor    	a,@0x3f
jbs    	status,z
jmp    	again00
call       MainIniti
nop
nop
nop
nop
mov        a,@11111000b
mov        p6,a
mov        a,@11111111b
mov        p7,a
call       dealy
;mov        a,@00000111b
;iow        ioc6
mov        a,@0xff
mov        p6,a
mov        p7,a
bc         p7,EL
;bc         p7,stopin
nop
nop
;******************************************
;****************************************
/*---------------------------------------

       Main Loop list

----------------------------------------*/
;****************************************
MainLoop:
wdtc
jbs         p7,stopin
bs          teshu,guanma
jbc         p7,stopin
bc          teshu,guanma
nop
nop
jbc         Flag00,TEndBit
call        MainIniti
nop
nop
;----------------------------------------
jbc         Flag10,ModeHandBit
bc          flagseg11,3  
nop
nop
call        RelayExchange    ;call all sub list
nop
nop
call        BellWorkOn       ;call Bell sub
nop
nop
jbs         Teshu,wen_kong100msbit 
jmp         ee
bc          Teshu,wen_kong100msbit 
jbs         Flag00,WorkBit 
jmp         ee
nop
nop
jbs        teshu,wen_kong1sBit
jmp        ee
mov        a,@00000111b
iow        ioc6
mov        a,@0xff
mov        p6,a
mov        p7,a
bc         teshu,wen_kong1sBit
bc         Flag00,WorkBit 
call        bi_bi_bi
ee:
nop
nop
nop
nop
bs          status,ps0
bc          status,ps1
nop
nop
jmp         page2
page1:
bc          status,ps0
bc          status,ps1
nop
nop
;****************************************
;****************************************
;call        T60minsList    ;call T60minsList
;****************************************
;T60mins list
T60minsList:
;disi
jbs	    Flag10,T1minBit
jmp        T60minsReturn
bc         Flag10,T1minBit
;----------------------------------------
djz        RegTime60mins                 ;一小时定时到关机
jmp        T60minsReturn
mov        a,@CTime60mins
mov        RegTime60mins,a
call       bi_bi_bi
call       MainIniti      ;shut out
;----------------------------------------
T60minsReturn:
;eni
nop
nop
;****************************************
;****************************************
;----------------------------------------
;jbs         Flag20,ScanKeyT1msBit
;jmp         MainLoop
;bc          Flag20,ScanKeyT1msBit
;djz         RegKeyTime
;jmp         MainLoop
;mov         a,@CKeyTime
;mov         RegKeyTime,a
;----------------------------------------
;由段码线组合KEY SCAN LIST
jbs         Teshu,key100msBit
jmp         MainLoop
bc          Teshu,key100msBit
disi
KeyScan:
nop
nop
call        Key3sScan
nop
nop
nop
nop
nop
nop
jbc         Flag20,LoosenKeyBit
jmp         LoosenKeyWait00
;----------------------------------------
jbs    	 p5,key0
jmp    	 KeyScanYes00   ;judge key wased pressed
jbs    	 p5,key1
jmp    	 KeyScanYes00
jbs     	p5,key2
jmp    	 KeyScanYes00
jbs     	p5,key3
jmp     	KeyScanYes00
jbs     	p5,key4
jmp     	KeyScanYes00
jbs         p5,key5

⌨️ 快捷键说明

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