📄 com_trig.lst
字号:
dspa -q -l -s -i../../../rtmon -i../../../sys/bldc3_2/asm -i..\..\..\rtmon -i..\..\..\sys\bldc3_2\asm -v2xx -iC:/CCStudio_v3.1/c2400/cgtools/include -g com_trig.asm com_trig.obj
TMS320C24xx COFF Assembler Version 7.04 Wed Dec 28 11:23:51 2005
Copyright (c) 1987-2003 Texas Instruments Incorporated
com_trig.asm PAGE 1
1 ;====================================================================================
2 ; Module Name: COMTN_TRIG
3 ;
4 ; File Name: com_trig.asm
5 ;
6 ; Description:
7 ; |~~~~~~~~~~~~~~~|
8 ; cmtn_ptr_ct o------>| |
9 ; Va o------>| COMTN_TRIG |
10 ; Vb o------>| |----->o cmtn_trig
11 ; Vc o------>| |
12 ; v_timer o------>| |
13 ; |_______________|
14 ;
15 ; Note: v_timer (virtual timer) is a "global" resource
16 ;
17 ; Target dependency: C2xx core only
18 ;
19 ;=====================================================================================
20 ; History:
21 ;-------------------------------------------------------------------------------------
22 ; 9-15-2000 Release Rev 1.00
23 ;====================================================================================
24 ;(To use this Module, copy this section to main system file)
25 ; .ref COMTN_TRIG, COMTN_TRIG_INIT ;function call
26 ; .ref Va, Vb, Vc, cmtn_trig, cmtn_ptr_ct ;Inputs/output
27 ; .ref debug_Bemf, NW_DYN_THOLD
28 ; .ref cdnw_delta, noise_window_max
29 ;=====================================================================================
30 ;Module definitions for external reference.
31 .def COMTN_TRIG, COMTN_TRIG_INIT ;function call
32 .def Va, Vb, Vc, cmtn_trig, cmtn_ptr_ct ;Inputs/output
33 .def debug_Bemf, NW_DYN_THOLD
34 .def cdnw_delta, noise_window_max
35 .def zc_trig, neutral, rev_period
36 ;=====================================================================================
37 .include x24x_app.h
38
39
40 .ref v_timer
41 ;=====================================================================================
42 ;Variable Definitions for comtn_trig module
43 ;-------------------------------------------------------------------------------------
44 0000 cmtn_trig .usect "com_trig",1 ;Commutation trigger output
45 0001 cmtn_ptr_ct .usect "com_trig",1
46 0002 zc_trig .usect "com_trig",1
47 0003 dt_task_ptr .usect "com_trig",1
48 0004 neutral .usect "com_trig",1
49 0005 rev_period .usect "com_trig",1
50 0006 Va .usect "com_trig",1
51 0007 Vb .usect "com_trig",1
52 0008 Vc .usect "com_trig",1
53 0009 time_stamp_new .usect "com_trig",1
54 000a time_stamp_old .usect "com_trig",1
TMS320C24xx COFF Assembler Version 7.04 Wed Dec 28 11:23:51 2005
Copyright (c) 1987-2003 Texas Instruments Incorporated
com_trig.asm PAGE 2
55 000b cmtn_delay .usect "com_trig",1
56 000c cmtn_delay_cntr .usect "com_trig",1
57 000d D30_done_flg .usect "com_trig",1
58
59 000e noise_window_cntr .usect "com_trig",1
60 000f noise_window_max .usect "com_trig",1
61
62 0010 cdnw_delta .usect "com_trig",1
63 0011 NW_DYN_THOLD .usect "com_trig",1
64 0012 GPR0_COM_TRIG .usect "com_trig",1
65 0013 GPR1_COM_TRIG .usect "com_trig",1
66 0014 debug_Bemf .usect "com_trig",1
67
68 0000 CMTN_STATE_TBL:
69 0000 001c' .word CT_STATE_ANB ;cmtn_ptr_ct = 0, de-energized phase = C
70 0001 002a' .word CT_STATE_ANC ;cmtn_ptr_ct = 1, de-energized phase = B
71 0002 0038' .word CT_STATE_BNC ;cmtn_ptr_ct = 2, de-energized phase = A
72 0003 0046' .word CT_STATE_BNA ;cmtn_ptr_ct = 3, de-energized phase = C
73 0004 0054' .word CT_STATE_CNA ;cmtn_ptr_ct = 4, de-energized phase = B
74 0005 0064' .word CT_STATE_CNB ;cmtn_ptr_ct = 5, de-energized phase = A
75
76 ;=====================================================================================
77 0006 COMTN_TRIG_INIT:
78 ;=====================================================================================
79 0006 bc00- ldp #dt_task_ptr
80 0007 ae03- SPLK #CHK_TRIGGER, dt_task_ptr
0008 0098'
81 0009 ae0e- SPLK #0, noise_window_cntr
000a 0000
82 000b ef00 RET
83
84
85 ;=====================================================================================
86 000c COMTN_TRIG:
87 ;=====================================================================================
88 000c bc00- ldp #cmtn_trig
89 000d ae00- SPLK #0,cmtn_trig ;always clear flag on entry
000e 0000
90
91 ;--------------------------
92 ;Neutral voltage calculation:
93 ;----------------------------
94 000f NEU_CALC:
95 000f be47 SETC SXM ; Sign extension mode on
96 0010 1006- LACC Va
97 0011 2007- ADD Vb
98 0012 2008- ADD Vc ;Acc=3*neutral point voltage
99 0013 9004- SACL neutral ;Store 3*neutral point voltage
100
101 ;--------------------------
102 ;Commutation State table Tasks
103 ;--------------------------
104 0014 STATE_TASKS:
105 0014 ae02- SPLK #0h,zc_trig ;always clear flag on entry
TMS320C24xx COFF Assembler Version 7.04 Wed Dec 28 11:23:51 2005
Copyright (c) 1987-2003 Texas Instruments Incorporated
com_trig.asm PAGE 3
0015 0000
106 0016 bf80 LACC #CMTN_STATE_TBL ;point to State table
0017 0000'
107 0018 2001- ADD cmtn_ptr_ct
108 0019 a612- TBLR GPR0_COM_TRIG
109 001a 1012- LACC GPR0_COM_TRIG
110 001b be20 BACC
111
112 ;State 0 - ZC for phase C
113 ;-----------------------
114 001c CT_STATE_ANB:
115 001c 1108- LACC Vc,1 ;Fetch Vc
116 001d 2008- ADD Vc ;ACC=3*(Bemf + Neutral)
117 001e 3004- SUB neutral ;ACC=3*Bemf
118 001f 9014- SACL debug_Bemf
119 0020 e304 BCND CLR_NW_S0,GT ;BEMF Still positive?
0021 0026'
120 0022 7a80 CALL NOISE_WIN
0023 00ac'
121 0024 7980 B ST_END
0025 0094'
122
123 0026 ae0e- CLR_NW_S0 SPLK #0h,noise_window_cntr
0027 0000
124 0028 7980 B ST_END
0029 0094'
125
126 ;State 1 - ZC for phase B
127 ;-----------------------
128 002a CT_STATE_ANC:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -