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

📄 main11a.c

📁 DSP,FIR设计
💻 C
字号:
//
//
// Main routine fir LAB11A - C54x
//
// Scott F. Bland  9/22/2000
#include <stdio.h>
#include "mmdrv.h"
#include "cpu_reg.h"    


// Define Sample and Tap sizes for function

#define RESULTS  185
#define TAPS 16

// Initialize Coefficient Table

#pragma DATA_SECTION (a,"coeffs");
int a[TAPS] = {0x7FC, 0x7FD, 0x7FE, 0x7FF,
      	       0x800, 0x801, 0x802, 0x803,
      	       0x803, 0x802, 0x801, 0x800,
               0x7FF, 0x7FE, 0x7FD, 0x7FC};

// Specify specific address for the result: y

#pragma DATA_SECTION (y,"yloc");
int y[RESULTS];

// include initialized x array

#include "in11.h"

extern void fir(int taps,int results,int *y);

main()
{
  int i;
 	SWWSR = 0x7fff;
    SWCR = 0x0001;
    BSCR = 0x8006;	  
    CLKMD = PLL_DIV_INIT;
    waitloop( 0x0400 );
    CLKMD = PLL_LOCK_INIT_X(5);	
    waitloop( 0x0400 );        
	PMST = 0x0168;

  // set wait states to zero using in-line assembly
//  asm("\t STM		#0,SWWSR");
//  asm("\t STM		#7FE8h,PMST");
  for(i= 0 ;i<RESULTS;i++)
  {
  	y[i]=0;
  }
   
  // call assembly FIR routine	
  fir(TAPS,RESULTS,y);
  while(1)
  {
    asm("\t nop\t");
  }
}	

⌨️ 快捷键说明

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