📄 com_trig.lst
字号:
C:\TIC2XX\C2000\CGTOOLS\BIN\DSPA.EXE -q -v2xx -gs com_trig.asm -o ..\obj\com_trig.obj -l ..\temp\com_trig.lst
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:21 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
com_trig.asm PAGE 1
1 ;=====================================================================================
2 ; File name: COM_TRIG.ASM
3 ;
4 ; Originator: Digital Control Systems Group
5 ; Texas Instruments
6 ;
7 ; Description:
8 ; This file contains commutation trigger points generation routine.
9 ;=====================================================================================
10 ; History:
11 ;-------------------------------------------------------------------------------------
12 ; 9-15-2000 Release Rev 1.0
13 ;================================================================================
14 ; Applicability: F240,F241,C242,F243,F24xx. (Peripheral Independant).
15 ;
16 ;
17 ;================================================================================
18 ; Routine Name: Commutation trigger generator module Routine Type: C Callable
19 ;
20 ; Description:
21 ; This module determines the Bemf zero crossing points
22 ; of a 3-phase BLDC motor and then generates the commutation
23 ; trigger points for the 3-phase power inverter switches.
24 ;
25 ; C prototype : int cmtn_trig_calc( *p);
26 ;================================================================================
27 ; History Created July 22, 2000
28 ;
29 ;
30 ;==========================================================================
31 ; Definition of CMTN:
32 ;
33 ;typedef struct {
34 ; int trig;
35 ; int va;
36 ; int vb;
37 ; int vc ;
38 ; int zc_trig;
39 ; int ptr_ct;
40 ; int debug_Bemf;
41 ; int noise_windowCntr;
42 ; int d30_doneFlg;
43 ; int time_stampNew;
44 ; int time_stampOld;
45 ; int v_timer;
46 ; int delay;
47 ; int dt_taskFlg ;
48 ; int noise_windowMax;
49 ; int delay_cntr;
50 ; int cdnw_delta;
51 ; int nw_dynThold;
52 ; (int(*)(int))cmtn_trig_calc;
53 ;} CMTN;
54 ;================================================================================
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:21 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
com_trig.asm PAGE 2
55 ; Frame Usage Details:
56 ; | a
57 ;____________|__________________________________
58 ; FR0 | |
59 ; FR1 | 1. neutral |
60 ; | 2. rev_period |
61 ; | 3. remainder |
62 ; | |
63 ; FR2 | GPR0_COM_TRIG. |
64 ;================================================================================
65
66
67 ;--------------------------------------------------------------------------------
68 .def _cmtn_trig_calc
69 ;--------------------------------------------------------------------------------
70 0000 CLEAR .set 0000h
71 7fff CYCLE_LENGTH .set 7FFFh
72 000f GONE_THRO_ONCE .set 0Fh
73
74
75 0003 __CMTN_framesize .set 0003h
76
77 0000 _cmtn_trig_calc:
78 ;================================================================================
79
80 ; AR0 is the frame pointer, AR1 is the stack
81 ; pointer. ARP = AR1
82
83 0000 8aa0 POPD *+ ; Save the return address from hardware
84 ; stack onto the software stack
85 ; ARP = AR1
86
87 0001 80a0 SAR AR0,*+ ; push AR0 (FP). ARP = AR1
88
89 0002 8180 SAR AR1,* ; *SP = SP. ARP = AR1 .
90
91 0003 b003 LAR AR0, #__CMTN_framesize
92 ; FP = size of frame. ARP = AR1
93
94 0004 00ea LAR AR0,*0+,AR2 ; Allocate frame. AR0 = *AR1
95 ; AR1 = AR1 + AR0. ARP = AR2
96
97 0005 bf0a LAR AR2,#-3 ; AR2 = -3. ARP = AR2
0006 fffd
98
99 0007 8be0 MAR *0+ ; AR2 -> passed parameter
100 ; (i.e. pointer to the structure).
101 ; ARP = AR2. AR2 = AR0 - 3
102 ;================================================================================
103 ; ARP = AR2. AR2 -> structure pointer
104 0008 0480 LAR AR4,* ; AR4 points to the first structure member
105 ; (i.e. AR4 -> trig).
106 ;--------------------------------------------------------------------------------
107 0009 0580 LAR AR5,* ; AR5 points to the first structure member
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:21 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
com_trig.asm PAGE 3
108 ; (i.e. AR5 -> trig).
109 ; AR4-> trig. AR2 -> structure pointer
110 ; ARP = AR2.
111 ;--------------------------------------------------------------------------------
112 000a 0380 LAR AR3,* ; ARP = AR2. AR2 -> structure pointer .
113 ; AR3 points to the first structure member
114 ; (i.e. AR3 -> trig). AR4-> trig.
115 ; AR5 -> trig.
116 ;--------------------------------------------------------------------------------
117 000b b201 LAR AR2,#1 ; AR2 = 1. ARP = AR2.
118 ; AR3 -> trig. AR4-> trig. AR5 -> trig.
119 ;--------------------------------------------------------------------------------
120 000c 8bec MAR *0+,AR4 ; AR2 -> FR1
121 ; ARP = AR4. AR4 -> trig. AR3 -> trig.
122 ; AR5 -> trig.
123 ;================================================================================
124
125 ; Neutral Voltage Calculation
126 ;--------------------------------------------------------------------------------
127 000d __CMTN_neu_calc:
128 000d be47 SETC SXM ; Sign extension mode ON
129 ; AR2 -> FR1. ARP = AR4.
130 ; AR4 -> trig. AR3 -> trig.
131 ; AR5 -> trig.
132 ;--------------------------------------------------------------------------------
133 000e bf80 LACC #CLEAR ; Always clear flag on entry.
000f 0000
134 ; AR2 -> FR1. ARP = AR4.
135 ; AR4 -> trig. AR3 -> trig.
136 ; AR5 -> trig.
137 ;--------------------------------------------------------------------------------
138 0010 90a0 SACL *+ ; trig = 0.
139 ; ARP = AR4. AR4-> va. AR3-> trig
140 ; AR2-> FR1. AR5-> trig
141 ;--------------------------------------------------------------------------------
142 0011 10a0 LACC *+ ; Accumulator = va.
143 ; ARP = AR4. AR4-> vb. AR5-> trig
144 ; AR3-> trig. AR2-> FR1.
145 ;--------------------------------------------------------------------------------
146 0012 20a0 ADD *+ ; Accumulator = (va + vb).
147 ; ARP = AR4. AR4 -> vc. AR5-> trig
148 ; AR3-> trig. AR2-> FR1.
149 ;--------------------------------------------------------------------------------
150 0013 20aa ADD *+, AR2 ; Accumulator = (va + vb + vc).
151 ; AR4 -> zc_trig. AR3-> trig.
152 ; ARP = AR2. AR2 -> FR1 (neutral).
153 ; AR5-> trig.
154 ;--------------------------------------------------------------------------------
155 0014 90ac SACL *+,AR4 ; neutral = (va + vb + vc) = 3*neutral voltage(Vn)
156 ; AR2 -> FR2 (GPR0_COM_TRIG).
157 ; ARP = AR4. AR4 -> zc_trig. AR3-> trig.
158 ; AR5-> trig.
159 ;================================================================================
160
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:21 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
com_trig.asm PAGE 4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -