网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 61IC中国电子在线 >> DSP >> C3000文章 >> VC33X系列 >> 文章正文
  基于TMS320VC33的fir滤波器代码       ★★★ 【字体:
基于TMS320VC33的fir滤波器代码
作者:61IC录入    文章来源:本站原创    点击数:    更新时间:2005-10-16    
实现 基于vc33的fir滤波器:

;Serial Port 0 registers
                       .global        BEGIN
sport                .set    808040h                ; Serial Port 0 global control register
xpctrl      .set    808042h             ; FSX/DX/CLKX port control
rpctrl      .set    808043h             ; FSR/DR/CLKR port control
rxtctrl     .set    808044h             ; r/x timer control register
rxtcnt      .set    808045h             ; r/x timer counter register
rxtprd      .set    808046h             ; r/x period register
xdata       .set    808048h             ; Data transmit register
rdata       .set    80804Ch            ; Data receive register
t0_GO       .set    001cfh              ; Timer configuration to GO
           
giebit            .set        2000h                ; GIE bit in ST register
eint3_cpu   .set    08h                 ; Enable bit for INT3 in IE register
int3_cpu_if .set    08h                 ; INT3 bit in IF register

                       .data
s0_rxcntr   .int    00000000h        ; Serial Clock will be configured
s0_rxprd    .int    00020002h        ; to run at 3.125 MHz
sp0_cfg           .word   0c140044h        ; SP0 GCR configuration word
adc_init    .word   0000a000h        ; ADC initialization word
adc_cfg     .word   0000a022h        ; repeat mode configuration word
adc_sel_0   .word   00000000h           ; to read input channel 0
adc_sel_1   .word   00001000h           ; to read input channel 1
fifo_read        .word        0000e000h        ; FIFO read command
DP_reg          .word        00800000h         ; DP pointer
startData        .word        00809c10h        ; start of data in RAM
endData                .word        00809d0fh        ; end of data in RAM  
outnew_addr .word   00800d10h           ;
stack_addr  .word   00800e0fh           ;
xn_addr                 .word        xn
hn_addr                 .word        hn
xnnew_addr  .word   00809c14h           ;
hn                .int         1,2
xn                .int    3, 1
N                .word        6

*****************************************************
*        Main Program
*****************************************************
                       .text
begin        ldp           DP_reg                        ; Load Data Page pointer
               ldi                @stack_addr,sp
               ldi                @N,bk              
               ldi            4,rc      
               ldp                hn_addr  
               ldi                @hn_addr,ar0
               ldi                @xn_addr,ar1
               ldi                @xnnew_addr,ar2
               ldi                @outnew_addr,ar3
loop        ldf                *ar2,r6
               stf                r6,*ar1++(1)%
               call        fir
               stf                r0,*AR3
           br                loop
   
  ************************************************************************
*      FIR
************************************************************************
 
fir                mpyf3        *ar0++(1),*ar1++(1)%,r0      ; 初始化R0h(N-1)*x(n-(N-1))=R0
               ldf                0.0,r2                       ; 初始化R2
               rpts    rc                           ; 设置重复次数        
       mpyf3        *ar0++(1),*ar1++(1)%,r0      ; h(N-1-i)*x(n-(N-1-i))=R0
           ||addf3        r0,r2,r2                     ; 乘累加
               addf3        r0,r2,r0                     ; 加上最后一个乘积
               rets                                 ; 返回
.end

********************************************************************************
* Place assembly initialization routine and interrupt vectors here
********************************************************************************
               .sect "vectors"
              b            int_isr
*********************************************************************************
                     .end                        ; end of repeat_mode


               欢迎点击进入:TI德州中文网   (国内唯一针对TI应用的中文技术网站)    文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    没有相关文章
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    站长:61IC 湘ICP备05002478号