⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rmp2cntl.lst

📁 TI的digital motor control lib的源代码。了解TI的编程规范
💻 LST
📖 第 1 页 / 共 2 页
字号:
C:\TIC2XX\C2000\CGTOOLS\BIN\DSPA.EXE -q -v2xx -gs rmp2cntl.asm -o ..\obj\rmp2cntl.obj -l ..\temp\rmp2cntl.lst 

TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:19 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
rmp2cntl.asm                                                         PAGE    1

       1            ;=====================================================================================
       2            ; File name:        RMP2CNTL.ASM                      
       3            ;                    
       4            ; Originator:   Digital Control Systems Group
       5            ;                       Texas Instruments
       6            ;
       7            ; Description:                                 
       8            ; This file contains source for a ramp up and ramp down 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            ;
      17            ;================================================================================
      18            ; Routine Name : RMP2CNTL                    Routine Type: C Callable.
      19            ;
      20            ; Description  : This module implements a ramp up and ramp down function.
      21            ;  
      22            ;  C prototype : void rmp2_calc(RMP2 *p);
      23            ;================================================================================
      24            ; History     Created July 26, 2000.
      25            ;
      26            ; Definition of RMP2:
      27            ;
      28            ;  typedef struct RMP2{
      29            ;
      30            ;  int max;               /*  Maximum  value of Ramp2                        */
      31            ;  int min;               /*  Minimum  value of Ramp2                        */
      32            ;  int dly;               /*  Ramp 2 step delay in number of sampling cycles */
      33            ;  int delay_cntr;        /*  Counter for ramp 2 step delay                  */
      34            ;  int desired;           /*  Desired value of ramp2                         */
      35            ;  int out;               /*  Ramp2 output                                   */
      36            ;  (int (*)(int))rmp2_calc)  /*  Pointer to the calculation function         */
      37            ;  } ;
      38            ;
      39            ;================================================================================
      40            
      41      0001  ON  .set 1
      42      0000  OFF .set 0
      43            ;--------------------------------------------------------------------------------
      44      0001  RETURN_ADDRESS_SAVE  .set ON    
      45                                            ; If this function calls no other functions 
      46                                            ; set RETURN_ADDRESS_SAVE to OFF for
      47                                            ; optimization. 
      48            ;--------------------------------------------------------------------------------     
      49                .def _rmp2_calc
      50            ;================================================================================ 
      51            
      52 0000       _rmp2_calc:
      53            
      54      0001  __RMP2_framesize    .set 0001h
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:19 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
rmp2cntl.asm                                                         PAGE    2

      55            ;--------------------------------------------------------------------------------
      56                .if (RETURN_ADDRESS_SAVE=ON)
      57                                            ; AR1 = stack pointer (SP)
      58                                            ; AR0 = frame pointer (FP)
      59                                            ; ARP = AR1
      60                
      61 0000 8aa0      POPD *+                     ; Save  return address from hardware stack onto 
      62                                            ; the software stack.
      63               .endif
      64               
      65 0001 80a0      SAR  AR0,*+                 ; push AR0 (FP). ARP = AR1
      66 0002 8180      SAR  AR1,*                  ; *SP = SP. ARP = AR1
      67 0003 b001      LAR AR0,#__RMP2_framesize   ; FP = size of frame. ARP = AR1
      68 0004 00ea      LAR  AR0,*0+,AR2            ; Allocate frame. AR0 = *AR1
      69                                            ; AR1 = AR1 + AR0. ARP = AR2
      70            ;================================================================================ 
      71                                             
      72               .if(RETURN_ADDRESS_SAVE=ON)          
      73 0005 bf0a      LAR    AR2,#-3
         0006 fffd  
      74               .endif
      75               
      76               .if(RETURN_ADDRESS_SAVE=OFF)
      77                LAR    AR2,#-2
      78               .endif                      
      79               
      80            ;--------------------------------------------------------------------------------   
      81 0007 8be0                  MAR     *0+     ; AR2 -> passed parameter
      82                                            ; (i.e. pointer to the structure).
      83                                            ; ARP = AR2. AR2 = AR2 + AR0. 
      84            ;--------------------------------------------------------------------------------   
      85 0008 0380                  LAR     AR3,*   ; AR3 points to the first structure member  
      86                                            ; (i.e. AR3 -> Max)
      87                                            ; ARP = AR2. 
      88            ;--------------------------------------------------------------------------------
      89 0009 048c                  LAR     AR4,* ,AR4 
      90                                            ; ARP = AR4. 
      91                                            ; AR4 points to the first structure member 
      92                                            ; (i.e.AR4 -> Max)
      93                                            ; AR3-> Max 
      94            ;--------------------------------------------------------------------------------
      95 000a 7805                  ADRK    #5      ; ARP = AR4.
      96                                            ; AR3-> Max. AR4-> Out. 
      97            ;--------------------------------------------------------------------------------
      98 000b 108b                  LACC   *,AR3    ; Accumulator = Out.
      99                                            ; ARP = AR3. AR3-> Max. AR4-> Out
     100            ;--------------------------------------------------------------------------------
     101 000c 7804                  ADRK    #4      ; Points to Desired
     102                                            ; ARP = AR3. AR3-> Desired   AR4-> Out
     103            ;--------------------------------------------------------------------------------
     104 000d 3090                  SUB     *-      ; Accumulator = Out - Desired.
     105                                            ; ARP = AR3.  AR3-> Delay_cntr. AR4-> Out.
     106            ;-------------------------------------------------------------------------------
     107 000e e388                  BCND rmp2_calc_exit, EQ      
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:19 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
rmp2cntl.asm                                                         PAGE    3

         000f 0030' 
     108                                            ; ARP = AR3.  AR3-> Delay_cntr. AR4-> Out.
     109                                            ; If(out == desired) go to RMP2_calc_exit.
     110            ;--------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -