13楼
编程示例。。。不过图不错啊大体也看明白了,我来发一个之前用过的AD9850的程序
Send_Control_Word_9850(luint ConTrol_Word)
{luint ConTrol_Word_Temporary ;
uchar data_word ;
w_clk_9850 = 0x00;
fqud_9850 = 0x00;
data_word = 0x00;
dataport_9850 = data_word;
w_clk_9850=1;
w_clk_9850=0;
ConTrol_Word_Temporary = ConTrol_Word;
ConTrol_Word = ConTrol_Word >> 24;
data_word = ConTrol_Word % 256;
dataport_9850 = data_word;
w_clk_9850=1;
w_clk_9850=0;
ConTrol_Word = ConTrol_Word_Temporary;
ConTrol_Word = ConTrol_Word >> 16;
data_word = ConTrol_Word % 256;
dataport_9850 = data_word;
w_clk_9850=1;
w_clk_9850=0;
ConTrol_Word = ConTrol_Word_Temporary;
ConTrol_Word = ConTrol_Word >> 8;
data_word = ConTrol_Word % 256;
dataport_9850 = data_word;
w_clk_9850=1;
w_clk_9850=0;
ConTrol_Word = ConTrol_Word_Temporary;
data_word = ConTrol_Word % 256;
dataport_9850 = data_word;
w_clk_9850=1;
w_clk_9850=0;
fqud_9850=1;
}
Calculate_Control_Word_9850(luint Frequency_Out_9850)
{
Con_Word_1_9850 = Frequency_Out_9850 * 42;
Con_Word_2_9850 = Frequency_Out_9850 *0.94967296;
Con_Word_2_9850 = Con_Word_2_9850 + 0.5;
Con_Word_1_9850 = Con_Word_1_9850 + Con_Word_2_9850;
ConTrol_Word_9850 = Con_Word_1_9850 / 1;
}
init_9850()
{ reset_9850 = 1;
delay_9850(10000);
reset_9850 = 0;
}
Write_9850()
{
init_9850();
Calculate_Control_Word_9850(Frequency_Out_9850);
delay_9850(10000);
Send_Control_Word_9850(ConTrol_Word_9850);
}
回复
有奖活动 | |
---|---|
【有奖活动——B站互动赢积分】活动开启啦! | |
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |