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

📄 chip_init.c

📁 TMS320C6713的语音信号的FIR滤波
💻 C
字号:
#include "6713.h"
#include "cfg6713.h"
#include "evm6713.h"
#include "functions.h"
/*
void init_emif( void )
{
	*(int *)EMIF_GCTL     = EMIF_GCTL_VAL;
	*(int *)EMIF_CE0      = EMIF_CE0;           /* CE0 SDRAM                     */
	//*(int *)EMIF_CE1      = EMIF_CE1;           /* CE1 Flash 16-bit               */
	//*(int *)EMIF_SDRAMCTL = EMIF_SDRAMCTL_VAL;  /* SDRAM control                 */
	//*(int *)EMIF_SDRAMTIM = EMIF_SDRAMTIM_VAL;  /* SDRAM timing (refresh)        */
	//*(int *)EMIF_SDRAMEXT = EMIF_SDRAMEXT_VAL;  /* SDRAM Extension register      */
//}
void  init_pll( void )
{
    *(int *)PLL_CSR  &= ~CSR_PLLEN;
    *(int *)PLL_CSR  |= CSR_PLLRST;
    *(int *)PLL_DIV0    = DIV_ENABLE + 0;  
    *(int *)PLL_MULT    = 8;               
    *(int *)PLL_OSCDIV1 = DIV_ENABLE + 4;
    *(int *)PLL_DIV3    = DIV_ENABLE + 3; 
    *(int *)PLL_DIV2    = DIV_ENABLE + 3; 
    *(int *)PLL_DIV1    = DIV_ENABLE + 1; 
    *(int *)PLL_CSR  &= ~CSR_PLLRST;
    *(int *)PLL_CSR |= CSR_PLLEN;

}

void initInterrupt(void)
{
	CSR=CSR&0xfffffffe;
	ISTP=0x800;
   	EIP=0x0;
   	IMH=0;
   	IML=0x18ad;
   	ICR=0xff;	
	IER=0x13;
	CSR=CSR|1; 	
}
void init_MCBSP0(void)
{
//init MCBSP0 
/*
McBSP0_SPCR=SPCR0_VAL;	//0x18c0008    Address of serial port contl. reg.   
McBSP0_RCR=RCR0_VAL;   //0x18c000C    Address of receive control reg.      
McBSP0_XCR=XCR0_VAL;   //0x18c0010    Address of transmit control reg.     
McBSP0_SRGR=SRGR0_VAL; //0x18c0014    Address of sample rate generator     
McBSP0_MCR=MCR0_VAL;   //0x18c0018    Address of multichannel reg.         
McBSP0_RCER=RCER0_VAL; //0x18c001C    Address of receive channel enable.   
McBSP0_XCER=XCER0_VAL; //0x18c0020    Address of transmit channel enable.  
McBSP0_PCR=PCR0_VAL;   //0x18c0024    Address of pin control reg.          
McBSP0_SPCR=SPCR0_VAL+0x1;//enable receive
*/
    McBSP0_SPCR =0;             
    McBSP0_RCR =0x0140;        
    McBSP0_XCR =0x0140;     
    McBSP0_PCR = 0x03;          
    McBSP0_SRGR = 0x20000001;     
    McBSP0_SPCR=0x00c30001;     
}

void init_MCBSP1(void)
{
//init MCBSP1 
/* 
 McBSP1_SPCR=SPCR1_VAL;	//0x1900008    Address of serial port contl. reg.   
 McBSP1_RCR=RCR1_VAL;   //0x190000C    Address of receive control reg.      
 McBSP1_XCR=XCR1_VAL;   //0x1900010    Address of transmit control reg.     
 McBSP1_SRGR=SRGR1_VAL; //0x1900014    Address of sample rate generator     
 McBSP1_MCR=MCR1_VAL;   //0x1900018    Address of multichannel reg.         
 McBSP1_RCER=RCER1_VAL; //0x190001C    Address of receive channel enable.   
 McBSP1_XCER=XCER1_VAL; //0x1900020    Address of transmit channel enable.  
 McBSP1_PCR=PCR1_VAL;   //0x1900024    Address of pin control reg.          
 McBSP1_SPCR=SPCR1_VAL+0x1;//enable receive
*/  
    McBSP1_SPCR = 0;               
    McBSP1_RCR  = 0;
    McBSP1_XCR  = 0x10040;            
    McBSP1_SRGR = 0x20001363;     
    McBSP1_PCR  = 0xa0a;         
    McBSP1_SPCR = 0xC51000;
   
    
}
void chip_sel( void )
{
   DEVCFG = 0x0;

}

⌨️ 快捷键说明

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