📄 bldc3_21.lst
字号:
dspa -q -l -s -i../../../rtmon -i../../../sys/bldc3_2/asm -i..\..\..\rtmon -i..\..\..\sys\bldc3_2\asm -v2xx -iC:/ti/c2400/cgtools/include -g bldc3_21.asm bldc3_21.obj
TMS320C24xx COFF Assembler Version 7.02 Mon Apr 28 11:35:36 2003
Copyright (c) 1987-2002 Texas Instruments Incorporated
bldc3_21.asm PAGE 1
1 ;=========================================================================================
2 ; System Name: BLDC3_2
3 ;
4 ; File Name: BLDC3_21.ASM
5 ;
6 ; Description: Implements sensorless control of BLDC motor with trapezoidal
7 ; Bemf.
8 ;
9 ; Target Device:F243, F2407
10 ; To Select the target device see x24x_app.h file.
11 ;
12 ;
13 ;
14 ;
15 ; Last Update: 6-29-2000
16 ; _________________________________________________________________________________________
17 ; Date of Mod | DESCRIPTION
18 ; ------------|----------------------------------------------------------------------------
19 ; 6-29-00 Release REV 01
20 ;
21 ; 10-24-00 This version is used for ASP and CMP1 motors
22 ;==========================================================================================
23 ;
24 ;SYSTEM OPTIONS
25 ;******************************************************************************************
26 0001 real_time .set 1 ;set to 1 for real time mode, otherwise set 0
27
28 0001 phase1_inc_build .set 1
29 0000 phase2_inc_build .set 0
30 0000 phase3_inc_build .set 0
31 0000 phase4_inc_build .set 0
32 0000 phase5_inc_build .set 0
33
34 ;select BLDC motor type
35 0000 wjw .set 0
36 0000 kvb .set 0
37 0000 aub .set 0
38 0000 ads .set 0
39 0000 aBB .set 0
40 0001 asp .set 1
41 0000 pxi .set 0
42 0000 cmp1 .set 0
43
44 ;------------------------------------------------------------------------------------------
45 ; External references
46 ;------------------------------------------------------------------------------------------
47
48 .include "x24x_app.h"
49
50 .global MON_RT_CNFG
51 .global v_timer
52
53 .ref SYS_INIT
54
TMS320C24xx COFF Assembler Version 7.02 Mon Apr 28 11:35:36 2003
Copyright (c) 1987-2002 Texas Instruments Incorporated
bldc3_21.asm PAGE 2
55 .ref DATA_LOG, DATA_LOG_INIT ;function call
56 .ref dlog_iptr1, dlog_iptr2 ;Inputs
57 .ref trig_value
58
59 .ref DAC_VIEW_DRV, DAC_VIEW_DRV_INIT ;function call
60 .ref DAC_IPTR0, DAC_IPTR1, DAC_IPTR2, DAC_IPTR3 ;Inputs
61
62 .ref ADC04U_DRV, ADC04U_DRV_INIT ;function call
63 .ref A4_ch_sel,C1_gain,C2_gain,C3_gain,C4_gain ;inputs
64 .ref C1_out, C2_out, C3_out, C4_out ;Outputs
65
66
67 .ref RMP2CNTL, RMP2CNTL_INIT ;function call
68 .ref rmp2_dly, rmp2_desired ;Inputs
69 .ref rmp2_out ;Output
70 .ref rmp2_max, rmp2_min
71
72 .ref RMP3CNTL, RMP3CNTL_INIT ;function call
73 .ref rmp3_desired, rmp3_dly ;Inputs
74 .ref rmp3_out, rmp3_done_flg ;Outputs
75 .ref rmp3_min
76
77 .ref IMPULSE, IMPULSE_INIT ;function call
78 .ref ig_period, ig_out ;Inputs
79
80 .ref MOD6_CNT, MOD6_CNT_INIT ;function call
81 .ref m6_trig_in, m6_cntr ;Inputs
82
83 .ref BLDC_3PWM_DRV, BLDC_3PWM_DRV_INIT ;function call
84 .ref cmtn_ptr_bd, D_func, Mfunc_p
85
86 .ref COMTN_TRIG, COMTN_TRIG_INIT ;function call
87 .ref Va, Vb, Vc, cmtn_trig, cmtn_ptr_ct
88 .ref debug_Bemf, NW_DYN_THOLD
89 .ref cdnw_delta, noise_window_max
90 .ref zc_trig, neutral, rev_period
91
92 .ref PID_REG2, PID_REG2_INIT ;function call
93 .ref pid_fb_reg2, pid_ref_reg2 ;Inputs
94 .ref pid_out_reg2, ;Output
95 .ref pid_max_reg2, pid_min_reg2
96 .ref K0_reg2, K1_reg2, Kc_reg2
97
98 .ref BC_INIT,BC_CALC ;function call
99 .ref BC_IN,BC_OUT ;Inputs/Outputs
100
101 .ref SPEED_REV_PRD, SPEED_REV_PRD_INIT ;function call
102 .ref event_period ;Input
103 .ref rpm_max, speed_scaler,shift ;parameter
104 .ref speed_prd, speed_rpm ;Outputs
105 ;-------------------------------------------------------------------------------------------
106 ; Local Variable Declarations
107 ;-------------------------------------------------------------------------------------------
108
TMS320C24xx COFF Assembler Version 7.02 Mon Apr 28 11:35:36 2003
Copyright (c) 1987-2002 Texas Instruments Incorporated
bldc3_21.asm PAGE 3
109 .if (x243)
110 ;SYSTEM_INT_PERIOD .set 1000 ;50uS sampling period @50nS CPU clock
111 ;SYSTEM_INT_PERIOD .set 700 ;17.5 uS sampling period @25nS CPU clock
112 ;SYSTEM_INT_PERIOD .set 360 ;18 uS sampling period @50nS CPU clock
113 ;SYSTEM_INT_PERIOD .set 450 ;22.5 uS sampling period @50nS CPU clock
114 SYSTEM_INT_PERIOD .set 500 ;25 uS sampling period @50nS CPU clock
115 .endif
116
117 .if (x2407)
118 ;SYSTEM_INT_PERIOD .set 758 ;25 uS sampling period @33nS CPU clock
119 03e8 SYSTEM_INT_PERIOD .set 1000 ;25 uS sampling period @25nS CPU clock
120 .endif
121
122
123 .def GPR0
124 .def GPR1
125 .def GPR2
126 .def v_timer
127 .def align_flag
128
129 0000 .bss GPR0,1
130 0001 .bss GPR1,1
131 0002 .bss GPR2,1
132 0003 .bss v_timer,1
133 0004 .bss current_set,1
134 0005 .bss GPR3,1
135 0006 .bss I_loop_flg,1
136
137 0007 .bss D_func_desired,1
138 0008 .bss align_flag,1
139
140 0009 .bss cmtn_period_target,1
141 000a .bss cmtn_period_setpt,1
142 000b .bss sp_up_done_flg,1
143 000c .bss ramp_delay,1
144 000d .bss loop_cnt,1
145 000e .bss isr_ticker,1
146
147 ;===========================================================================================
148 ; V E C T O R T A B L E ( including RT monitor traps )
149 ;===========================================================================================
150 .include "c200mnrt.i"
151
152 0000 .sect "vectors"
153 .def _c_int0
154
155 0000 7980 RESET B _c_int0 ; 00
0001 0000'
156 0002 7980 INT1 B PHANTOM ; 02
0003 00d7'
157 0004 7980 INT2 B PHANTOM ; 04
0005 00d7'
158 0006 7980 INT3 B T2_PERIOD_ISR ; 06
0007 0081'
TMS320C24xx COFF Assembler Version 7.02 Mon Apr 28 11:35:36 2003
Copyright (c) 1987-2002 Texas Instruments Incorporated
bldc3_21.asm PAGE 4
159 0008 7980 INT4 B PHANTOM ; 08
0009 00d7'
160 000a 7980 INT5 B PHANTOM ; 0A
000b 00d7'
161 000c 7980 INT6 B PHANTOM ; 0C
000d 00d7'
162
163
164
165 .include "rtvecs.h"
166
167 ; Note : The above include line must be AFTER the user configurable
168 ; vectors. Do not change the place where this line is included.
169
170
171
172 ;==========================================================================================
173 ; M A I N C O D E - starts here
174 ;==========================================================================================
175 0000 .text
176 0000 _c_int0:
177 0000 7a80 CALL SYS_INIT
0001 0000!
178 0002 7a80 CALL DAC_VIEW_DRV_INIT
0003 0000!
179 0004 7a80 CALL DATA_LOG_INIT
0005 0000!
180 0006 7a80 CALL BLDC_3PWM_DRV_INIT
0007 0000!
181 0008 7a80 CALL IMPULSE_INIT
0009 0000!
182 000a 7a80 CALL MOD6_CNT_INIT
000b 0000!
183 000c 7a80 CALL ADC04U_DRV_INIT
000d 0000!
184 000e 7a80 CALL RMP3CNTL_INIT
000f 0000!
185 0010 7a80 CALL COMTN_TRIG_INIT
0011 0000!
186 0012 7a80 CALL PID_REG2_INIT
0013 0000!
187 0014 7a80 CALL RMP2CNTL_INIT
0015 0000!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -