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

📄 data_log.asm

📁 无速度pid的异步电机vf控制的dsp调试程序
💻 ASM
字号:
;====================================================================================
; File Name:	Data_log.asm
;
; Module Name: 	DATA_LOG					      
;
; Initialization Routine: DATA_LOG_INIT
;
; Originator:	Digital Control Systems Group
;			Texas Instruments
;
; Description:	Stores the realtime values of two user selectable s/w 
;		variables in the external data RAM provided on the 24x/24xx
;		EVM. Two s/w variables are selected by configuring two 
;		module inputs, dlog_iptr1 and dlog_iptr2, point to the 
;		address of the two variables. The starting addresses of the 
;		two RAM locations, where the data values are stored, are set 
;		to 8000h and 8400h. Each section allows logging of 400 data 
;		values.
;
;				|~~~~~~~~~~~~~~~~~~~~~~~|	  
;	dlog_iptr1	o------>|		  	|
;   	dlog_iptr2    	o------>|    DATA_LOG/ Data RAM |
;   	 		o------>|		     	|
;				|_______________________|	   
;
;
; Target dependency:	C2xx core only
;
;
;=====================================================================================
; History:
;-------------------------------------------------------------------------------------
; 9-15-2000	Release	Rev 1.0
;===========================================================================
;(To use this Module, copy this section to main system file)
;		.ref		DATA_LOG, DATA_LOG_INIT		;function call
;		.ref		dlog_iptr1, dlog_iptr2		;Inputs
;		.ref		trig_value						;Inputs
;===========================================================================
;Module definitions for external reference.
		.def		DATA_LOG, DATA_LOG_INIT		;function call
		.def		dlog_iptr1, dlog_iptr2		;Inputs

;===========================================================================
		.include	x24x_app.h


DLOG_PRESCALE	.set	1			;1 gives 50uS log rate
DL_BUFFER1_ADR	.set	08000h
DL_BUFFER2_ADR	.set	08400h
DLOG_CNTR_MAX	.set	400h
LOG_MAX         .set	100

dlog_iptr1	.usect "data_log",1
dlog_iptr2	.usect "data_log",1
dlog_skip_cntr	.usect "data_log",1
dlog_cntr	.usect "data_log",1
task_ptr	.usect "data_log",1
graph_ptr1	.usect "data_log",1
graph_ptr2	.usect "data_log",1
count	.usect "data_log",1
flag       .usect "data_log",1   
      
;-----------------------------------------------------------------------------
DATA_LOG_INIT:
;-----------------------------------------------------------------------------
		LDP	#task_ptr
;		SPLK	#POS_TRIG_S1, task_ptr
		SPLK	#DL_BUFFER1_ADR, graph_ptr1
		SPLK	#DL_BUFFER2_ADR, graph_ptr2
		SPLK	#295h, dlog_iptr1
		SPLK	#291h, dlog_iptr2
     	SPLK	#0h, flag		;flag=0 means need datalog
		SPLK	#0h, count		;Set trig point to 0h		
		SPLK	#0h, dlog_cntr		;clear Data log counter

		RET

;---------------------------------------------------------------------------------
DATA_LOG:
;---------------------------------------------------------------------------------
		LDP	#task_ptr
		MAR	*, AR5
		SETC	SXM
        lacc count
		add #1
		sacl count
		SUB #LOG_MAX
		BCND	DL_EXIT, NEQ
		LACC #0
		SACL count
        lacc flag
	    BCND DL_EXIT,NEQ
		LACC	dlog_cntr			;Check if Data buffer full
		ADD	#1
		SACL	dlog_cntr
		SUB	#DLOG_CNTR_MAX
		BCND	DL_EXIT1, EQ
	;Data is logged here
		LAR	AR5, dlog_iptr1
		LACC	*
		LAR	AR5, graph_ptr1
		SACL	*+
		SAR	AR5, graph_ptr1

		LAR	AR5, dlog_iptr2
		LACC	*
		LAR	AR5, graph_ptr2
		SACL	*+
		SAR	AR5, graph_ptr2
        
		B DL_EXIT
DL_EXIT1:LACC #1
         SACL flag

DL_EXIT
		CLRC	SXM
		RET

⌨️ 快捷键说明

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