📄 sys_timer.asm
字号:
;==========================================================================================; SH69P822;; (c) Copyright 2006-2007, Sino Wealth Microelectronics Corporation Limited; All Rights Reserved;; module name : Sys_Timer.asm version : 1.0; function : ; by : CLR; in : 2007-02-13;;==========================================================================================;-----------------------------------------------------------------------------------------;variable;*** refer to Ram_user.inc;-----------------------------------------------------------------------------------------;constantTIMER_SYSTEM_5MS EQU 5 ; 5ms (5*1ms)TIMER_SYSTEM_100MS EQU 100/5 ; 100ms (20*5ms)TIMER_SYSTEM_500MS EQU 500/100 ; 500ms (5*100ms)TIMER_SYSTEM_30MIN EQU 30*120 ; 30minTIMER_IRON_5000MS EQU 5000/5 ; 5000ms (1000*5ms);==========================================================================================; TimerProcessor;input : zIntFlag.0;==========================================================================================TimerProcessor: lda zIntFlag ,0 ba0 System1ms jmp TimerProcessor_Over ;------------------------------------------------------------------------------------------System1ms: ldi zIntFlag ,0110b ;zIntFlag.1 -- Wheel Debounce ;zIntFlag.2 ;zIntFlag.3 -- IRON Ctrl sbim zLEDRefreshTime ,01h bnz ?next ldi zLEDRefreshTime ,LED_REFRESH_TIME orim zIntFlag1 ,0001b ;zIntFlag1.0 -- LED ?next: ;------------------------------------------------------------------------------------------System5ms: sbim zCounter_System5ms ,01h bnz TimerProcessor_Over ldi zCounter_System5ms ,TIMER_SYSTEM_5MS orim zIntFlag1 ,1110b ;zIntFlag1.1 -- SetMode ;zIntFlag1.2 ;zIntFlag1.3;------------------------------------------------------------------------------------------System100ms: sbim zCounter_System100ms_L ,01h eor zCounter_System100ms_L ,0 sbcm zCounter_System100ms_H ,0 or zCounter_System100ms_L ,0 bnz TimerProcessor_Over ldi zCounter_System100ms_L ,TIMER_SYSTEM_100MS&0fh ldi zCounter_System100ms_H ,(TIMER_SYSTEM_100MS>>4)&0fh orim zIntFlag ,1000b ;zIntFlag.3 -- IronCtrl orim zIntFlag2 ,0100b;------------------------------------------------------------------------------------------System500ms: sbim zCounter_System500ms_L ,01h eor zCounter_System500ms_L ,0 sbcm zCounter_System500ms_H ,0 or zCounter_System500ms_L ,0 bnz TimerProcessor_Over ldi zCounter_System500ms_L ,TIMER_SYSTEM_500MS&0fh ldi zCounter_System500ms_H ,(TIMER_SYSTEM_500MS>>4)&0fh orim zIntFlag2 ,0011b ;zIntFlag2.0 -- LEDSpark ;zIntFlag2.1 -- Iron WorkState Update ;zIntFlag2.2 -- ReservedSystem30min: sbim zCounter_System30min+0 ,01h eor zCounter_System30min+0 ,0 sbcm zCounter_System30min+1 ,0 eor zCounter_System30min+1 ,0 sbcm zCounter_System30min+2 ,0 or zCounter_System30min+1 ,0 or zCounter_System30min+0 ,0 bnz TimerProcessor_Over ldi zCounter_System30min+0 ,TIMER_SYSTEM_30MIN&0fh ldi zCounter_System30min+1 ,(TIMER_SYSTEM_30MIN>>4)&0fh ldi zCounter_System30min+2 ,(TIMER_SYSTEM_30MIN>>8)&0fh // Enable the following struction for nonstop heating // eorim zIntFlag2 ,1000b ;zIntFlag2.3 -- Pause;------------------------------------------------------------------------------------------TimerProcessor_Over: jmp Exit_TimerProcessor ;----------------------------------------END-----------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -