📄 speed_fr.lst
字号:
C:\TIC2XX\C2000\CGTOOLS\BIN\DSPA.EXE -q -v2xx -gs speed_fr.asm -o ..\obj\speed_fr.obj -l ..\temp\speed_fr.lst
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:26 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
speed_fr.asm PAGE 1
1 ;=====================================================================================
2 ; File name: SPEED_FR.ASM
3 ;
4 ; Originator: Digital Control Systems Group
5 ; Texas Instruments
6 ;
7 ; Description: This file contains source for a speed calculation function.
8 ;
9 ;=====================================================================================
10 ; History:
11 ;-------------------------------------------------------------------------------------
12 ; 01-14-2002 Release Rev 1.0
13 ;================================================================================
14 ; Applicability: F240,F241,C242,F243,F24xx. (Peripheral Independant).
15 ;================================================================================
16 ; Routine Name: speed_frq Routine Type: C Callable
17 ;
18 ; Description:
19 ;
20 ; C prototype : int speed_frq(SPEED_MEAS *)
21 ;================================================================================
22 ; The definition for the Speed Frequency Object is as follows:
23 ;
24 ;typedef struct { int theta_elec; /* Input: Electrical angle (Q15) */
25 ; int K1_fr; /* Parameter: Constant for differentiator (Q6) */
26 ; int theta_old; /* History: Electrical angle at previous step (Q15) */
27 ; int K2_fr; /* Parameter: Constant for low-pass filter (Q15) */
28 ; int speed_frq; /* Output: Speed in per-unit (Q15) */
29 ; int K3_fr; /* Parameter: Constant for low-pass filter (Q15) */
30 ; int rpm_max; /* Parameter: Base speed in rpm (Q0) */
31 ; int speed_rpm; /* Output : Speed in rpm (Q0) */
32 ; int (*calc)(); /* Pointer to the calulation function */
33 ; } SPEED_MEAS; /* Data type created */
34 ;
35 ;================================================================================
36 ; Frame Usage Details:
37 ; | a | b | c | d
38 ;____________|______________|_______________|__________|____________
39 ; FR0 | tmp1 | | |
40 ;
41 ;
42 ;================================================================================
43 .def _speed_frq
44 ;================================================================================
45 7333 DIFF_MAX_LIMIT_FR .set 7333h ; Maximum limit to differentiate angle (Q15)
46 0ccd DIFF_MIN_LIMIT_FR .set 0CCDh ; Minimum limit to differentiate angle (Q15)
47
48 ; Important!! Note that the default DIFF_LIMIT are shown, if it is neccessary
49 ; to be changed, the module library (e.g., clib_011.lib) must be rebuilt to take the effect.
50 ;================================================================================
51 0001 __speed_frq_framesize .set 0001h
52 ;================================================================================
53 0000 _speed_frq:
54 ; Assume
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:26 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
speed_fr.asm PAGE 2
55 0000 8aa0 POPD *+ ; Keep return address
56 0001 80a0 SAR AR0,*+ ; Keep old frame pointer (FP)
57 0002 8180 SAR AR1,* ; Keep old stack pointer (SP)
58 0003 b001 LARK AR0,__speed_frq_framesize ; Load AR0 with frame size
59 0004 00e8 LAR AR0,*0+,AR0 ; AR0->FP0 (new FP), ARP=AR0
60
61 ;=================================================================================
62 0005 7c03 SBRK #3 ; ARP=AR0, AR0->FR0-3 (1st argument)
63 ;----------------------------------------------------------------------------------
64 0006 0280 LAR AR2,* ; ARP=AR0, AR0->dir_QEP, AR2->theta_elec
65 ;----------------------------------------------------------------------------------
66 0007 7803 ADRK #3 ; ARP=AR0, AR0->FR0, AR2->theta_elec
67 ;----------------------------------------------------------------------------------
68 0008 8b8a MAR *,AR2 ; ARP=AR2, AR0->FR0, AR2->theta_elec
69 ;----------------------------------------------------------------------------------
70 0009 be47 SETC SXM ; Turn sign extension mode on
71 ; ARP=AR2, AR0->FR0, AR2->theta_elec
72 ;----------------------------------------------------------------------------------
73 000a be43 SETC OVM ; Set overflow mode
74 ; ARP=AR2, AR0->FR0, AR2->theta_elec
75 ;----------------------------------------------------------------------------------
76 000b bf00 SPM 0 ; Reset product mode
77 ; ARP=AR2, AR0->FR0, AR2->theta_elec
78 ;----------------------------------------------------------------------------------
79 000c bf80 LACC #DIFF_MAX_LIMIT_FR ; ACC = DIFF_MAX_LIMIT (Q15)
000d 7333
80 ; ARP=AR2, AR0->FR0, AR2->theta_elec
81 ;----------------------------------------------------------------------------------
82 000e 3080 SUB * ; ACC = DIFF_MAX_LIMIT - theta_elec (Q15)
83 ; ARP=AR2, AR0->FR0, AR2->theta_elec
84 ;----------------------------------------------------------------------------------
85 000f e304 BCND LESS_MAX_FR,GT ; Branch to LESS_MAX if DIFF_MAX_LIMIT > theta_elec
0010 0013'
86 ; ARP=AR2, AR0->FR0, AR2->theta_elec
87 ;----------------------------------------------------------------------------------
88 0011 7980 B SKIP_DIFF_FR ; ARP=AR2, AR0->FR1, AR2->theta_elec
0012 002d'
89 ;----------------------------------------------------------------------------------
90 0013 LESS_MAX_FR ; ARP=AR2, AR0->FR0, AR2->theta_elec
91 ;----------------------------------------------------------------------------------
92 0013 bf80 LACC #DIFF_MIN_LIMIT_FR ; ACC = DIFF_MIN_LIMIT (Q15)
0014 0ccd
93 ; ARP=AR2, AR0->FR0, AR2->theta_elec
94 ;----------------------------------------------------------------------------------
95 0015 3080 SUB * ; ACC = DIFF_MIN_LIMIT - theta_elec (Q15)
96 ; ARP=AR2, AR0->FR0, AR2->theta_elec
97 ;----------------------------------------------------------------------------------
98 0016 e344 BCND MORE_MIN_FR,LT ; Branch to MORE_MIN if DIFF_MIN_LIMIT < theta_elec
0017 001a'
99 ; ARP=AR2, AR0->FR0, AR2->theta_elec
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -