DSPTMS320C5509A之初始化(一)

15 篇文章 1 订阅

DSP其实本质上讲和ARM差不多,只不过乘法运算能力和浮点运算能力强,

在相同的主频下,有很高的MIPS(每秒百万指令集)运算能力,得益于

DSP的哈佛架构和设计上的优化处理,特别适合做数学运算。

但是DSP的 外设不太友好,调试复杂尤其是TI的DSP芯片手册不适合新手入门,

且GPIO口特别少。

以TMSC5509A开始介绍,初始化程序如下:

#include <csl.h>
#include <csl_pll.h>
#include <csl_mcbsp.h>
#include <csl_timer.h>
#include "stdio.h"
#include "Inc\DMA.h"
#include "Inc\I2C.h"
#include "Inc\Globe.h"
#include "Inc\DAC.h"
#include "Inc\DDS.h"
#include "Inc\Timer0.h"

/*锁相环的设置*/
PLL_Config  myPLLCfg = 
{
  0,    //IAI: the PLL locks using the same process that was underway 
                //before the idle mode was entered 采用上一次的锁相配置,按照例子此位应为1
  1,    //IOB: If the PLL indicates a break in the phase lock, 
                //it switches to its bypass mode and restarts the PLL phase-locking 
                //sequence                         重启锁相环 
  16,    //PLL multiply value; multiply 16 times   16倍频 25M*16=200M
  1             //Divide by 2 PLL divide value; it can be either PLL divide value 
                //(when PLL is enabled), or Bypass-mode divide value 2分频
                //(PLL in bypass mode, if PLL multiply value is set to 1)
};

void delay(Uint32 k)
{
   while(k--);
}

int old_intm;
extern void VECSTART(void);
extern TIMER_Handle mhTimer1;
int main()
{
	int old_intm,i,j;
	int tmp_data;
	long int tmp;
static    unsigned char a[19]={0};
	
	CSL_init();

	//设置系统的运行速度为200MHz
	PLL_config(&myPLLCfg);

	CHIP_FSET(SYSR,CLKDIV,4); 				//CLKOUT = 200M/8 = 25M

	IRQ_setVecs((Uint32)(&VECSTART));


	old_intm = IRQ_globalDisable();			//temporarily disable interrupts and clear any peding



	//初始化DMA
	IniDMA_CH0();		//ADC  MAX121
//	IniDMA_CH1();		//AUDIO	DAC8830
//	IniDMA_CH2();
	IniDMAPara();

	//初始化McBSP
	IniADC();
	IniAudioDAC();
	IniDAC8164D();

	
	SendToDAC8164(DAC_PORTA,AGC.curoutdata);
	

	IRQ_globalEnable();						//Enable all maskable interrupts

	//IRQ_globalRestore(old_intm);			//Restore status of global interrupt enable flag

	IniGlobeValue();						//初始化全局变量

	IniTimer0();							//初始化定时器0,为ADC的CONST提供采样间隔时钟
	
	ad9854_int();

	AD9854_SetSine_double(455000,4095);

	dds_flag = 1;
 
	while (1)
	{
//		a[0] = AD9854_RD_Byte(CTRL1_ADDRESS);
//		a[1] = AD9854_RD_Byte(CTRL2_ADDRESS); 
//		a[2] = AD9854_RD_Byte(CTRL3_ADDRESS); 
//		a[3] = AD9854_RD_Byte(CTRL4_ADDRESS); 
//		a[4] = AD9854_RD_Byte(OSK_I1_ADDRESS ); 
//		a[5] = AD9854_RD_Byte(OSK_I2_ADDRESS ); 
//		a[6] = AD9854_RD_Byte(OSK_Q1_ADDRESS ); 
//		a[7] = AD9854_RD_Byte(OSK_Q2_ADDRESS ); 
//		a[8] = AD9854_RD_Byte(FTW1_ADDRESS); 
//		a[9] = AD9854_RD_Byte(FTW2_ADDRESS); 
//		a[10] = AD9854_RD_Byte(FTW3_ADDRESS); 
//		a[11] = AD9854_RD_Byte(FTW4_ADDRESS); 
//		a[12] = AD9854_RD_Byte(FTW5_ADDRESS); 
//		a[13] = AD9854_RD_Byte(FTW6_ADDRESS); 
//		a[14] = AD9854_RD_Byte(UNCLOCK1_ADDRESS ); 
//		a[15] = AD9854_RD_Byte(UNCLOCK2_ADDRESS ); 
//		a[16] = AD9854_RD_Byte(UNCLOCK3_ADDRESS ); 
//		a[17] = AD9854_RD_Byte(UNCLOCK4_ADDRESS ); 
//		a[18] = AD9854_RD_Byte(OSK_RAMP_DATE_ADDRESS); 

	}
		
}

 

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值