AN908
DS00908A-page 56
2004 Microchip Technology Inc.
InvPark.s
;*******************************************************************
; InvPark
;
;Description:
; Calculate the inverse Park transform. Assumes the Cos and Sin values
; are in the ParkParm structure.
;
;
Valpha =
Vd*cos(Angle) - Vq*sin(Angle)
;
Vbeta =
Vd*sin(Angle) + Vq*cos(Angle)
;
; This routine works the same for both integer scaling and 1.15 scaling.
;
;Functional prototype:
;
; void InvPark( void )
;
;On Entry:
The ParkParm structure must contain qCos, qSin, qVd and qVq.
;
;On Exit:
ParkParm will contain qValpha, qVbeta.
;
;Parameters:
; Input arguments: None
;
; Return:
;
Void
;
; SFR Settings required:
;
CORCON.SATA
= 0
; Support routines required:
None
;
; Local Stack usage:
None
;
; Registers modified:
w3 -> w7, A
;
; Timing:
About 14 instruction cycles
;
;*******************************************************************
;
.include "general.inc"
; External references
.include "park.inc"
; Register usage
.equ ParmW,
w3
; Ptr to ParkParm structure
.equ SinW,
w4
.equ CosW,
w5
.equ VdW,
w6
; copy of qVd
.equ VqW,
w7
; copy of qVq
;=================== CODE =====================
.section
.text
.global
_InvPark
.global
InvPark