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

📄 impulse.asm

📁 无刷直流电机的无传感器控制TI程序
💻 ASM
字号:
;===========================================================================
; File Name:	impulse.asm
;
; Module Name: 	IMPULSE				     
;
; Initialization Routine: IMPULSE_INIT
;
; Originator:	Digital Control Systems Group
;			Texas Instruments
;
; Description:	This module implements a periodic impulse function. The 
;		output variable ig_out is set to 7FFF for 1 sampling period. 
;		The period of the output signal ig_out is specified by the 
;		input ig_period.
;
;			|~~~~~~~~~~~~~~~|
;			| 		|
;    ig_period	o------>|   IMPULSE	|----->o  ig_out
;			|		|
;			|_______________|
;
;
;
;=====================================================================================
; History:
;-------------------------------------------------------------------------------------
; 9-15-2000	Release	Rev 1.0
;=============================================================================
;(To use this Module, copy this section to main system file)
;		.ref	IMPULSE, IMPULSE_INIT			;function call
;		.ref	ig_period, ig_out			;Input/output
;=============================================================================
;Module definitions for external reference.
		.def	IMPULSE, IMPULSE_INIT			;function call
		.def	ig_period, ig_out			;Input/output

;=============================================================================
		.include	x24x_app.h
;=============================================================================
;Variable Definitions for impulse module
;-----------------------------------------------------------------------------

ig_skp_cnt	.usect	"impulse",1	;
ig_period	.usect	"impulse",1	;Time period for ig_out 
ig_out		.usect	"impulse",1	;Impulse output ig_out

;=============================================================================
IMPULSE_INIT:
;=============================================================================
		LDP	#ig_out
		SPLK	#0h, ig_skp_cnt
		SPLK	#1000h, ig_period		;default value
		RET

;=============================================================================
IMPULSE:
;=============================================================================
		LDP	#ig_out
		SPLK	#0h, ig_out	;always clear Impulse output on entry
		LACC	ig_skp_cnt	;check skip counter
		ADD	#1		;increment & store
		SACL	ig_skp_cnt
		SUB	ig_period
		BCND	IG_END, LT	;Skip setting Impulse high.
		SPLK	#7FFFh, ig_out
		SPLK	#0, ig_skp_cnt	;reset skip counter.
IG_END
		RET



⌨️ 快捷键说明

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