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

📄 pgm_alg.lst

📁 DSP F2407 烧写软件
💻 LST
📖 第 1 页 / 共 3 页
字号:
DSPA -G -S -l -v2xx pgm_alg.asm 

TMS320C24xx COFF Assembler Version 7.02  Tue Jul 29 10:56:11 2003
Copyright (c) 1987-2002  Texas Instruments Incorporated 
pgm_alg.asm                                                          PAGE    1

       1            ;--------------------------------------------------------------------------------------------------
       2            ; Filename         : PGM_ALG.ASM          
       3            ; Last Modified    : 25 May 2001.
       4            ; Version          : 1.0
       5            ; Originator       : Texas Instruments, DSP Digital Control Systems Group.
       6            ;--------------------------------------------------------------------------------------------------
       7            ; Description:
       8            ;
       9            ; This file contains the implementation of the core clear algorithm for 
      10            ; progamming user data into the LF240x Flash.
      11            ;--------------------------------------------------------------------------------------------------
      12            ;--------------------------------------------------------------------------------------------------
      13            ; Revision History
      14            ; 
      15            ; Ver 1.0 (25 May 2001)
      16            ; 
      17            ;           Comments: Derived from previous source code. Several modifications in place for 
      18            ;           enhanced embeddability.
      19            ;--------------------------------------------------------------------------------------------------
      20            ;--------------------------------------------------------------------------------------------------
      21            
      22            
      23            ;--------------------------------------------------------------------------------------------------
      24            ;
      25            ;--------------------------------------------------------------------------------------------------
      26            ; Symbols exported from this file
      27            ;--------------------------------------------------------------------------------------------------
      28                    .globl  PROGRAM_FLASH
      29            
      30            ;--------------------------------------------------------------------------------------------------
      31            ; Import register definitions and symbol declarations.
      32            ;--------------------------------------------------------------------------------------------------
      33                    .include ..\include\var.h
      34            
      35                    .include ..\include\rundefs.h
      36            ;--------------------------------------------------------------------------------------------------
      37            ; Program sections generated by this file:
      38            ; All code in this algorithm implementation is assembled into the named section 'ALG_Text". 
      39            ; Any relocation sensitive code is placed in the named section 'PSPL_text'.
      40            ;--------------------------------------------------------------------------------------------------
      41 0000                   .sect     "PGM_text"
      42            
      43            ;--------------------------------------------------------------------------------------------------
      44            ; Define macros to set the Flash Mode.
      45            ; ACCESS_REGS gives access to the Flash Registers in the Pgm Mem Space and ACCESS_ARRAY  gives 
      46            ; access to the Flash ARRAY in Pgm Mem Space.
      47            ;
      48            ;--------------------------------------------------------------------------------------------------
      49            ACCESS_REGS        .macro    
      50                            OUT    07fh,0ff0fh        
      51                            .endm
      52            
      53            ACCESS_ARRAY    .macro    
      54                            IN    07fh,0ff0fh
TMS320C24xx COFF Assembler Version 7.02  Tue Jul 29 10:56:11 2003
Copyright (c) 1987-2002  Texas Instruments Incorporated 
pgm_alg.asm                                                          PAGE    2

      55                            .endm
      56            
      57            ;--------------------------------------------------------------------------------------------------
      58            ; Define Short DELAY loop macro. 
      59            ;  This will be used to generate a short delay upto 256 cycles.
      60            ;--------------------------------------------------------------------------------------------------
      61            SDELAY          .macro  COUNT
      62                            RPT     COUNT
      63                            NOP
      64                            .endm
      65            ;--------------------------------------------------------------------------------------------------
      66            
      67            
      68            
      69            ;--------------------------------------------------------------------------------------------------
      70            ; PROGRAM_FLASH:
      71            ;--------------------------------------------------------------------------------------------------
      72            ; This function is the implementation of the clear algorithm for the pre-erase preconditioning of 
      73            ; the flash array. This function is desginated as a LEVEL_1 subroutine.
      74            ;--------------------------------------------------------------------------------------------------
      75 0000       PROGRAM_FLASH:                          ; Call label for assembly-language client applications.
      76 0000       _programFlash:                          ; Call label for C-language client applications.
      77 0000               .label  ProgramAlgoStartMain
      78 0000 bc00!         LDP     #flashAlgoVars.ADDR
      79 0001 8b8a          MAR     *,AR2
      80                    
      81            ;--------------------------------------------------------------------------------------------------
      82            ; Enable the flash for programming:
      83            ; To accept programming commands the following must happen:
      84            ;   1. Place the flash in the register mode.
      85            ;   2. Copy the sector key to the SECT register.
      86            ;   3. Enable the core by setting Bit 0 of the ENAB Register
      87            ;--------------------------------------------------------------------------------------------------
      88 0002       ENABLE: ACCESS_REGS                                              ;Put the flash in register mode.
1        0002 0c7f                  OUT    07fh,0ff0fh        
         0003 ff0f  
      89            
      90 0004 bf80          LACC    #SECT                                            ;Enable sector.
         0005 0006  
      91 0006 a801!         BLDD    #flashAlgoVars.SECTOR_CMD,flashAlgoVars.PAD      ;
         0007 000e! 
      92 0008 a701!         TBLW    flashAlgoVars.PAD       
      93            
      94 0009 bf80          LACC    #ENAB                                            ;Enable core.
         000a 0005  
      95 000b ae01!         SPLK    #0001h,flashAlgoVars.PAD                         ;
         000c 0001  
      96 000d a701!         TBLW    flashAlgoVars.PAD                                ;
      97            
      98            ;--------------------------------------------------------------------------------------------------
      99 000e ae09!         SPLK    #0000,flashAlgoVars.FL_CMD                       ;
         000f 0000  
     100            ;--------------------------------------------------------------------------------------------------
     101            ;       BLDD    flashAlgoVars.DATA_PTR,#flashAlgoVars.DATA       ;Point to first data 
TMS320C24xx COFF Assembler Version 7.02  Tue Jul 29 10:56:11 2003
Copyright (c) 1987-2002  Texas Instruments Incorporated 
pgm_alg.asm                                                          PAGE    3

     102                                                                             ;to be programmed.
     103            ;--------------------------------------------------------------------------------------------------
     104            ; PGM:
     105            ;--------------------------------------------------------------------------------------------------
     106            ; This is the loop at the core of the program algorithm. This performs the following steps to 
     107            ; program the flash with the new contents of the flash
     108            ;   1.  Reads the flash.
     109            ;   2.  Compares the contents read out to those pointed to by the 
     110            ;       variable DATA_PTR.
     111            ;   3.  If any bits need to be programmed forms a bitmask and calls the PROG
     112            ;       routine to apply the program pulse.
     113            ;
     114            ;--------------------------------------------------------------------------------------------------
     115 0010 ae05! PGM:    SPLK    #MX_PCNT,flashAlgoVars.PLS_CNT  ;Initialise the pulse counter.
         0011 00fa  
     116            
     117 0012       PGVERON:
     118 0012 bf80          LACC    #WADDR                          ;Load WADDR with the address of 
         0013 0002  
     119                                                            ;the word to be programmed.
     120 0014 7a80          CALL    SETWADDR                        ;Call the routine to do so.
         0015 0000+ 
     121            
     122 0016 1009!         LACC    flashAlgoVars.FL_CMD            ;Compose the flash command to read
     123                                                            ;the user space in PROGVER mode.
     124 0017 bfd0          XOR     #0004h              
         0018 0004  
     125 0019 9001!         SACL    flashAlgoVars.PAD    
     126            
     127 001a bf80          LACC    #CTRL                           ;Set up the PROGVER mode.
         001b 0001  
     128 001c a701!         TBLW    flashAlgoVars.PAD
     129 001d               SDELAY  #T_pvsu                         ;Wait for T_pvsu(P)
1        001d bb3a                  RPT     #T_pvsu
1        001e 8b00                  NOP
     130            
     131 001f bf80          LACC    #PMPC                           ;Activate the PROGVER mode.
         0020 0000  
     132 0021 ae01!         SPLK    #0005h,flashAlgoVars.PAD    
         0022 0005  
     133 0023 a701!         TBLW    flashAlgoVars.PAD
     134 0024               SDELAY  #T_pva_e                        ;Wait T_pva(E)
1        0024 bb07                  RPT     #T_pva_e
1        0025 8b00                  NOP
     135            
     136 0026 7a80          CALL    READWORD                        ;Read the word pointed to by ADDR.
         0027 0097+ 
     137                
     138 0028       PGVEROFF:
     139 0028 ae04!         SPLK    #0000h,flashAlgoVars.PAD1       ;Deactivate the PROGVER mode.
         0029 0000  
     140 002a 7a80          CALL    CLRCMD
         002b 00ab+ 
     141            
TMS320C24xx COFF Assembler Version 7.02  Tue Jul 29 10:56:11 2003
Copyright (c) 1987-2002  Texas Instruments Incorporated 
pgm_alg.asm                                                          PAGE    4

⌨️ 快捷键说明

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