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

📄 i_clarke.asm

📁 此源码为用于电力电子变换器的DSP汇编源程序
💻 ASM
字号:
;===========================================================================
; File Name:	I_clarke.asm
;
; Module Name: 	I_CLARKE				      
;
; Initialization Routine: I_CLARKE_INIT
;
;
; Description:	Converts balanced two phase quadrature quantities into balanced
;		three phase quantities. 
;				(d,q) -> (a,b,c) Transformation
;				Iclark_a = Iclark_d 
;				Iclark_b = (-Iclark_d + sqrt(3) * Iclark_q) / 2  
;				Iclark_c = (-Iclark_d - sqrt(3) * Iclark_q) / 2
;        
;				|~~~~~~~~~~~~~~~~~|
;	Iclark_d	o------>|		  |----->o  Iclark_a
;	    			|     I_CLARKE    |----->o  Iclark_b
;	Iclark_q	o------>|		  |----->o  Iclark_c
;				|_________________|
;	
;
;===========================================================================
;Module definitions for external reference.
		.def	I_CLARKE, I_CLARKE_INIT			;function call
		.def	Iclark_d, Iclark_q			;Inputs
		.def	Iclark_a, Iclark_b, Iclark_c		;Outputs
;===========================================================================
		.include	x24x_app.h

;Declaration for variable storage.

Iclark_d		.usect "I_clarke",1
Iclark_q		.usect "I_clarke",1
Iclark_a		.usect "I_clarke",1
Iclark_b		.usect "I_clarke",1
Iclark_c		.usect "I_clarke",1
half_sqrt3		.usect "I_clarke",1
                 
;=========================
I_CLARKE_INIT:	  
;=========================
		ldp		#half_sqrt3             ; Variables data page
		SPLK 	#28377,half_sqrt3 		; Set constant sqrt(3)*0.5 in Q15 format
		RET
   
;=========================
I_CLARKE:	  
;=========================
		ldp	#Iclark_d       ; Variables data page
	    SPM	1           	; SPM set for Q15 multiplication 
		SETC	SXM			; Sign extension mode on

	;Iclark_a = Iclark_q 	
		LACC	Iclark_d			; ACC = Iclark_q     
		SACL	Iclark_a			; Iclark_a = Iclark_q
        
	;Iclark_b = (-Ubeta + sqrt(3) * Ualfa) / 2  
		LT	Iclark_q				; TREG = Iclark_d
		MPY	half_sqrt3      ; PREG = Iclark_d * half_sqrt3     
		PAC                 ; ACC high = Iclark_d * half_sqrt3              
		SUB	Iclark_d,15     ; ACC high = Iclark_d * half_sqrt3 + Iclark_q/2 
		NEG
		SACH	Iclark_b      ; Iclark_b = Iclark_d * half_sqrt3 + Iclark_q/2
        
	;Iclark_c = (-Ubeta - sqrt(3) * Ualfa) / 2        
		PAC                 ; ACC high = Iclark_d * half_sqrt3 
		               ; ACC high = - Iclark_d * half_sqrt3
		SUB	Iclark_d,15     ; ACC high = - Iclark_d * half_sqrt3 - Iclark_q/2
		SACH	Iclark_c      ; Iclark_c = - Iclark_d * half_sqrt3 - Iclark_q/2
		SPM	0	            	; SPM reset
		CLRC	SXM						; Sign extension mode off
		RET
	

⌨️ 快捷键说明

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