📄 speed_pr.lst
字号:
C:\TIC2XX\C2000\CGTOOLS\BIN\DSPA.EXE -q -v2xx -gs speed_pr.asm -o ..\obj\speed_pr.obj -l ..\temp\speed_pr.lst
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:11 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
speed_pr.asm PAGE 1
1 ;=====================================================================================
2 ; File name: SPEED_PR.ASM
3 ;
4 ; Originator: Digital Control Systems Group
5 ; Texas Instruments
6 ;
7 ; Description:
8 ; This file contains source for a speed calculation function.
9 ;=====================================================================================
10 ; History:
11 ;-------------------------------------------------------------------------------------
12 ; 9-15-2000 Release Rev 1.0
13 ;================================================================================
14 ; Applicability: F240,F241,C242,F243,F24xx. (Peripheral Independant).
15 ;================================================================================
16 ; Routine Name: speed_prd Routine Type: C Callable
17 ;
18 ; Description:
19 ;
20 ; C prototype : int speed_prd(SPEED_MEAS *)
21 ;================================================================================
22 ; The definition for the Speed Period Object is as follows:
23 ;
24 ; typedef struct {
25 ; int time_stamp_new; /* Variable : New 'Timestamp' corresponding to a capture event */
26 ; int time_stamp_old; /* Variable : Old 'Timestamp' corresponding to a capture event */
27 ; int time_stamp; /* Input : Current 'Timestamp' corresponding to a capture event */
28 ; int shift; /* Parameter : For maximum accuracy of 32bit/16bit division */
29 ; int speed_scaler; /* Parameter : Scaler converting 1/N cycles to a Q15 speed */
30 ; int speed_prd; /* Output : speed in per-unit */
31 ; int rpm_max; /* Parameter : Scaler converting Q15 speed to rpm (Q0)speed */
32 ; int speed_rpm; /* Output : speed in r.p.m. */
33 ; int (*calc)(); /* Pointer to the calulation function */
34 ; } SPEED_MEAS; /* Data type created */
35 ;
36 ;================================================================================
37 ; Frame Usage Details:
38 ; | a | b | c d
39 ;____________|______________|_______________|_______________________
40 ; FR0 | event_period | |
41 ; FR1 | speed_hi | |
42 ; FR2 | speed_lo | |
43 ; FR3 | speed_prd_max| |
44 ; FR4 | shift2 | |
45 ;================================================================================
46 .def _speed_prd
47 ;================================================================================
48 000e SHIFT_TOTAL .set 14
49 ;================================================================================
50 0005 __speed_prd_framesize .set 0005h
51 ;================================================================================
52 0000 _speed_prd:
53 ; Assume
54 0000 8aa0 POPD *+ ; Keep return address
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:11 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
speed_pr.asm PAGE 2
55 0001 80a0 SAR AR0,*+ ; Keep old frame pointer (FP)
56 0002 8180 SAR AR1,* ; Keep old stack pointer (SP)
57 0003 b005 LARK AR0,__speed_prd_framesize ; Load AR0 with frame size
58 0004 00e8 LAR AR0,*0+,AR0 ; AR0->FP0 (new FP), ARP=AR0
59
60 ;=================================================================================
61 0005 7c03 SBRK #3 ; ARP=AR0, AR0->FR0-3 (1st argument)
62 ;----------------------------------------------------------------------------------
63 0006 0280 LAR AR2,* ; ARP=AR0, AR0->time_stamp_new, AR2->time_stamp_new
64 ;----------------------------------------------------------------------------------
65 0007 7803 ADRK #3 ; ARP=AR0, AR0->FR0, AR2->time_stamp_new
66 ;----------------------------------------------------------------------------------
67 0008 8b8a MAR *,AR2 ; ARP=AR2, AR0->FR0, AR2->time_stamp_new
68 ;----------------------------------------------------------------------------------
69 0009 be46 CLRC SXM ; Turn sign extension mode off
70 ; ARP=AR2, AR0->FR0, AR2->time_stamp_new
71 ;----------------------------------------------------------------------------------
72 000a be42 CLRC OVM ; Set overflow mode
73 ; ARP=AR2, AR0->FR0, AR2->time_stamp_new
74 ;----------------------------------------------------------------------------------
75 000b bf00 SPM 0 ; Reset product mode
76 ; ARP=AR2, AR0->FR0, AR2->time_stamp_new
77 ;----------------------------------------------------------------------------------
78 000c 10a0 LACC *+ ; ACC = time_stamp_new
79 ; ARP=AR2, AR0->FR0, AR2->time_stamp_old
80 ;----------------------------------------------------------------------------------
81 000d 90a0 SACL *+ ; time_stamp_old = time_stamp_new
82 ; ARP=AR2, AR0->FR0, AR2->time_stamp
83 ;----------------------------------------------------------------------------------
84 000e 1080 LACC * ; ACC = time_stamp
85 ; ARP=AR2, AR0->FR0, AR2->time_stamp
86 ;----------------------------------------------------------------------------------
87 000f 7c02 SBRK #2 ; ARP=AR2, AR0->FR0, AR2->time_stamp_new
88 ;----------------------------------------------------------------------------------
89 0010 90a0 SACL *+ ; time_stamp_new = time_stamp
90 ; ARP=AR2, AR0->FR0, AR2->time_stamp_old
91 ;----------------------------------------------------------------------------------
92 0011 30a0 SUB *+ ; ACC = time_stamp - time_stamp_old
93 ; ARP=AR2, AR0->FR0, AR2->time_stamp
94 ;----------------------------------------------------------------------------------
95 0012 8ba8 MAR *+,AR0 ; ARP=AR2, AR0->FR0, AR2->shift
96 ;----------------------------------------------------------------------------------
97 0013 e344 BCND NEG_DELTA, LT ; Branch to NEG_DELTA if ACC < 0 (allow "wrapping")
0014 0018'
98 ; ARP=AR0, AR0->FR0, AR2->shift
99 ;----------------------------------------------------------------------------------
100 0015 POS_DELTA ; ARP=AR0, AR0->FR0, AR2->shift
101 ;----------------------------------------------------------------------------------
102 0015 9080 SACL * ; FR0 = event_period = time_stamp - time_stamp_old
103 ; ARP=AR0, AR0->FR0, AR2->shift
104 ;----------------------------------------------------------------------------------
105 0016 7980 B CALC_SPEED ; ARP=AR0, AR0->FR0, AR2->shift
0017 001b'
106 ;----------------------------------------------------------------------------------
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:11 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
speed_pr.asm PAGE 3
107 0018 NEG_DELTA ; ARP=AR0, AR0->FR0, AR2->shift
108 ;----------------------------------------------------------------------------------
109 0018 bf90 ADD #07FFFh ; ACC = 7FFFh + time_stamp - time_stamp_old
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -