📄 rmp_cntl.asm
字号:
;===========================================================================
; Filename: RMP_CNTL.asm
;
; Module Name: RAMP_CNTL
;
; Initialization Routine: RAMP_CNTL_INIT
;
; Originator: Digital Control Systems Group
; Texas Instruments
;
; Description: This module implements a ramp up and ramp down function.
; The output flag variable s_eq_t_flg is set to 7FFFh when the
; output variable setpt_value equals the input variable target_value.
;
; |~~~~~~~~~~~~~~~|
; target_value o------->| |----->o setpt_value
; | RAMP_CNTL |
; | |----->o s_eq_t_flg
; |_______________|
;
; Target: C2xx core only
;
;=====================================================================================
; History:
;-------------------------------------------------------------------------------------
; 09-15-2000 Release Rev 1.0
; 10-06-2000 Release Rev 1.1
;===========================================================================
;(To use this Module, copy this section to main system file)
; .ref RAMP_CNTL, RAMP_CNTL_INIT ; function call
; .ref target_value ; Inputs
; .ref rmp_dly_max, rmp_lo_limit ; Input Parameters
; .ref rmp_hi_limit ; Input Parameter
; .ref setpt_value, s_eq_t_flg ; Outputs
;===========================================================================
;Module definitions for external reference.
.def RAMP_CNTL, RAMP_CNTL_INIT ; function call
.def target_value ; Inputs
.def rmp_dly_max, rmp_lo_limit ; Input Parameters
.def rmp_hi_limit ; Input Parameter
.def setpt_value, s_eq_t_flg ; Outputs
;===========================================================================
target_value .usect "rmp_cntl",1
setpt_value .usect "rmp_cntl",1
s_eq_t_flg .usect "rmp_cntl",1
rmp_delay_cntr .usect "rmp_cntl",1
rmp_dly_max .usect "rmp_cntl",1
rmp_lo_limit .usect "rmp_cntl",1
rmp_hi_limit .usect "rmp_cntl",1
RAMP_CNTL_INIT:
LDP #setpt_value
SPLK #0h,setpt_value
SPLK #0h,rmp_delay_cntr
SPLK #7,rmp_dly_max
SPLK #0300h,rmp_lo_limit
SPLK #07500h,rmp_hi_limit
RET
RAMP_CNTL:
SETC SXM ; Sign extension mode
SETC OVM ; Set Overflow mode
LDP #target_value
LACC target_value
SUB setpt_value
BCND SET_FLG, EQ ; If Set point = target
; set s_eq_t_flg = 7FFFh then exit
LACC rmp_delay_cntr
ADD #1
SACL rmp_delay_cntr
SUB rmp_dly_max
BCND SRC_EXIT, LT
CHNG_VALUE:
LACC target_value
SUB setpt_value
BCND INC_VALUE, GT
DEC_VALUE LACC setpt_value
SUB #1
SACL setpt_value
SUB rmp_lo_limit
BCND SRC_1, GEQ
LACC rmp_lo_limit
SACL setpt_value
B SRC_1
INC_VALUE LACC setpt_value
ADD #1
SACL setpt_value
SUB rmp_hi_limit
BCND SRC_1, LEQ
LACC rmp_hi_limit
SACL setpt_value
SRC_1:
SPLK #0, rmp_delay_cntr
SRC_EXIT
RET
SET_FLG
SPLK #7FFFh, s_eq_t_flg
RET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -