接
https://blog.csdn.net/pxy198831/article/details/87017571DSP TMS320C5509A 控制DDS AD9854芯片进行AM幅度调制
FSK调制就是用高低两个频率表示数字信号0,1
而AD9854有两个频率控制字寄存器,要预先把高低两种频率送给芯片,
然后通过切换芯片外围FSK控制引脚的高低电平实现FSK调制,代码如下:
int main()
{
int old_intm,i,j;
int tmp_data;
long int tmp;
static unsigned char a[19]={0};
int FSK[8]={0,1,0,1,0,1,0,1};
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(20000,4095);
AD9854_SetSine_double2(40000,4095);
AD9854_WR_Byte(OSK_I1_ADDRESS,0xff); //设置I通道幅度
AD9854_WR_Byte(OSK_I2_ADDRESS,0xff);
ad9854_update();
j=0;
while (1)
{
// dds_flag = 1;
if (FSK[j++]==1)
{
asm(" SSBX XF ");
}
else
{
asm(" RSBX XF ");
}
if (j==8)
{
j=0;
}
delay(1000);
}
}