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

📄 initc5402.asm

📁 一个滤波器和一个音效处理程序 TI 的CCS 编译器编程。
💻 ASM
字号:
; THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR
; REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, 
; INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 
; FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR 
; COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. 
; TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET 
; POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY 
; INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR 
; YOUR USE OF THE PROGRAM.
;
; IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, 
; CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY 
; THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED 
; OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT 
; OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. 
; EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF 
; REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS 
; OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF 
; USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S 
; AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF 
; YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS 
; (U.S.$500).
;
; Unless otherwise stated, the Program written and copyrighted 
; by Texas Instruments is distributed as "freeware".  You may, 
; only under TI's copyright in the Program, use and modify the 
; Program without any charge or restriction.  You may 
; distribute to third parties, provided that you transfer a 
; copy of this license to the third party and the third party 
; agrees to these terms by its first use of the Program. You 
; must reproduce the copyright notice and any other legend of 
; ownership on each copy or partial copy, of the Program.
;
; You acknowledge and agree that the Program contains 
; copyrighted material, trade secrets and other TI proprietary 
; information and is protected by copyright laws, 
; international copyright treaties, and trade secret laws, as 
; well as other intellectual property laws.  To protect TI's 
; rights in the Program, you agree not to decompile, reverse 
; engineer, disassemble or otherwise translate any object code 
; versions of the Program to a human-readable form.  You agree 
; that in no event will you alter, remove or destroy any 
; copyright notice included in the Program.  TI reserves all 
; rights not specifically granted under this license. Except 
; as specifically provided herein, nothing in this agreement 
; shall be construed as conferring by implication, estoppel, 
; or otherwise, upon you, any license or other right under any 
; TI patents, copyrights or trade secrets.
;
; You may not use the Program in non-TI devices.

************************************************************************
**  File Name:    InitC5402.asm
**  Part Number:  TLV320AIC10/11EVM-SW-0011
************************************************************************
**  Copyright (c) Texas Instruments, Inc. 2000
************************************************************************
**
**  Release History:
**     Version      Date          Engr          Description
**      1.00     10-11-2000    Wendy X Fang   Original Release
**
************************************************************************
**
**  Function:
**    This routine initializes C5402 DSP system and McBSP registers
**    for communication to AIC10/11EVM. 
**
************************************************************************
**  References:
**  	(1) TMS320C54x DSP, CPU and Peripheral (SPRU131)
**	(2) TMS320C54x DSP, Enhanced Peripheral (SPRU302)
************************************************************************

      .global     _InitC5402

************************************************************************
** Include Statements
************************************************************************
      .include	MMRegs.h

************************************************************************
**  C5402 DSP Memory Mapping Register Initialization
************************************************************************

_InitC5402:
      NOP



      LD     #0, DP                 ; reset data-page pointer
    
      STM        #0b,CLKMD
Tst:
      LDM        CLKMD,A
      AND        #01b,A
      BC         Tst,ANEQ
      STM        #1007h,CLKMD
        
     ; STM    #0, CLKMD              ; software setting of DSP clock
     ; STM    #0, CLKMD              ; (to divider mode before setting)
*      STM    #0x1007, CLKMD         ; set C5402 DSP clock to 40MHz
     ; STM   #0x4007, CLKMD          ; set C5402 DSP clock to 100MHz
                                    ; (based on DSK crystal at 20MHz) 
      
******* Configure C5402 System Registers *******
      STM   #0x2000, SWWSR          ; 2 wait cycle for IO space &
                                    ; 0 wait cycle for data&prog spaces 
      STM   #0x0000,BSCR            ; set wait states for bank switch:
                                    ; 64k mem bank, extra 0 cycle between
                                    ; consecutive prog/data read     
      STM   #0x1800,ST0             ; ST0 at default setting
      STM   #0x2900,ST1             ; ST1 at default setting(note:INTX=1)
      STM   #0x00A0,PMST            ; MC mode & OVLY=1, vectors at 0080h

******* Set up Timer Control Registers *******     
      STM   #0x0010, TCR            ; stop on-chip timer0  
      STM   #0x0010, TCR1           ; stop on-chip timer1 
                                    ; Timer0 is used as main loop timer
*      STM   #2499, PRD              ; timer0 rate=CPUCLK/1/(PRD+1)
                                    ;            =40M/2500=16KHz
      STM   #4607, PRD             ;  if CPU at 36.864M/2304=16KHz                                    

******* Initialize McBSP0 Registers *******
      STM   SPCR1,  McBSP0_SPSA     ; register subaddr of SPCR1
      STM   #0000h, McBSP0_SPSD     ; McBSP0 recv = left-justify
                                    ; RINT generated by frame sync                                    
      STM   SPCR2,  McBSP0_SPSA     ; register subaddr for SPCR2
                                    ; XINT generated by frame sync
      STM   #0200h, McBSP0_SPSD     ; McBSP0 Tx = FREE(clock stops 
                                    ; to run after SW breakpoint)                              

	  STM   PCR,    McBSP0_SPSA     ; register subaddress of PCR
      STM   #000Ch, McBSP0_SPSD     ; clk and frame from external (slave)
      
      STM   RCR1,   McBSP0_SPSA     ; register subaddr of RCR1
      STM   #0040h, McBSP0_SPSD     ; recv frame1 Dlength = 16 bits 
     
      STM   RCR2,   McBSP0_SPSA     ; register subaddr of RCR2
      STM   #0004h, McBSP0_SPSD     ; recv Phase = 1
                                    ; Set frame2 Dlength = 16bits

      STM   XCR1,   McBSP0_SPSA     ; register subaddr of XCR1
      STM   #0040h, McBSP0_SPSD     ; set the same as recv
      STM   XCR2,   McBSP0_SPSA     ; register subaddr of XCR2
      STM   #0004h, McBSP0_SPSD     ; set the same as recv
              
******* Initialize McBSP1 Registers *******
;      STM   SPCR1,  McBSP1_SPSA     
;      STM   #0000h, McBSP1_SPSD                                         
;      STM   SPCR2,  McBSP1_SPSA     
;      STM   #0200h, McBSP1_SPSD     
;	  STM   PCR,    McBSP1_SPSA     
 ;     STM   #000Ch, McBSP1_SPSD     
 ;     STM   RCR1,   McBSP1_SPSA     
 ;     STM   #0040h, McBSP1_SPSD     
 ;     STM   RCR2,   McBSP1_SPSA     
 ;     STM   #0004h, McBSP1_SPSD     
 ;     STM   XCR1,   McBSP1_SPSA     
 ;     STM   #0040h, McBSP1_SPSD     
 ;     STM   XCR2,   McBSP1_SPSA     
 ;     STM   #0004h, McBSP1_SPSD     
     

******* Finish DSP Initialization *******
	  STM   #0x0000, IMR            ; disable peripheral interrupts
      STM   #0x0000, IFR            ; clear the intrupts' flags
        
      RET                           ; return to main
      NOP
      NOP
	
      .end

************************************************************************
**  End of File -- InitC5402.asm
************************************************************************

⌨️ 快捷键说明

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