在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 3106|回复: 0

[求助] xilinx DDS产生的正弦信号通过DAC输出波形不平滑?

[复制链接]
发表于 2020-6-1 14:34:40 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
我用xilinx 的DDS ip核产生1Mhz的正弦信号通过并行DAC输出 输出的波形有问题,波形如下图说示,我在功能仿真的时候没有出现这个问题
142329ffifndfd1wiyi3f4.jpg

代码如下
  • `timescale 1ns / 1ps
  • //////////////////////////////////////////////////////////////////////////////////
  • // Company:
  • // Engineer:
  • //
  • // Create Date:    11:09:24 04/26/2020
  • // Design Name:
  • // Module Name:    signal_source_2ch
  • // Project Name:
  • // Target Devices:
  • // Tool versions:
  • // Description: 双通道DDS信号源
  • //
  • // Dependencies:
  • //
  • // Revision:
  • // Revision 0.01 - File Created
  • // Additional Comments:
  • //
  • //////////////////////////////////////////////////////////////////////////////////
  • module signal_source_2ch(
  •                 input clk_50MHz,                //时钟
  •                 input n_reset,                        //复位
  •                 input en,                                //使能
  •                 output [13:0] ch1_cosine,        //DDS1信号输出
  •                 output [13:0] ch1_sine,
  •                 output [45:0] ch1_phase_out,
  •                 output ch1_rdy,
  •                 output [13:0] ch2_cosine,        //DDS2信号输出
  •                 output [13:0] ch2_sine,
  •                 output [45:0] ch2_phase_out,
  •                 output ch2_rdy
  •     );
  • /////////////////////DDS IP 调用////////////////////////////
  • //DDS 通道1参数
  • reg [45:0] ch1_pinc_in;
  • reg [45:0] ch1_poff_in;
  • //wire [13:0] ch1_cosine;
  • //wire [13:0] ch1_sine;
  • //wire [27 :0] ch1_phase_out;
  • //wire ch1_rdy;
  • reg ch1_sclr;
  • //DDS 通道2参数
  • reg [45:0] ch2_pinc_in;
  • reg [45:0] ch2_poff_in;
  • //wire [13:0] ch2_cosine;
  • //wire [13:0] ch2_sine;
  • //wire [27 :0] ch2_phase_out;
  • //wire ch2_rdy;
  • reg ch2_sclr;
  • reg [8:0] count;
  • reg [45:0] phase_off;
  • //DDS CH1
  • always@(posedge clk_50MHz)
  •         if (n_reset == 0)        //同步复位
  •                 begin
  •                         //DDS CH1
  •                         ch1_sclr <= 1'b1;
  •                         ch1_pinc_in <= 46'd0;        //0Hz
  •                         ch1_poff_in <= 46'd0;        //0度
  •                 end
  •         else
  •                 begin
  •                         //DDS CH1
  •                         ch1_sclr <= 1'b0;
  •                         //ch1_pinc_in <= 46'd1407374883550;        //1MHz
  •                         ch1_pinc_in <= 46'd703687441;        //500Hz
  •                         ch1_poff_in <= 46'd0;        //0度
  •                 end
  • //DDS CH2
  • always@(posedge clk_50MHz)
  •         if (n_reset == 0)        //同步复位
  •                 begin
  •                         //DDS CH2
  •                         ch2_sclr <= 1'b1;
  •                         ch2_pinc_in <= 46'd0;        //0Hz
  •                         ch2_poff_in <= 46'd0;        //0度
  •                 end
  •         else
  •                 begin
  •                         //DDS CH2
  •                         ch2_sclr <= 1'b0;
  •                         ch2_pinc_in <= 46'd703687441;        //500Hz
  •                         //ch2_poff_in <= 46'd8796093022208;        //45度
  •                         ch2_poff_in <= 46'd0;
  •                         //ch2_poff_in <= phase_off;
  •                 end
  • always@(posedge clk_50MHz)
  •         if (n_reset == 0)        //同步复位
  •                 begin
  •                         count <= 0;
  •                         phase_off <= 46'd0;
  •                 end
  •         else
  •                 begin
  •                         if(count > 100)
  •                                 begin
  •                                         phase_off <= phase_off+46'd195468733827;
  •                                         count <= 0;
  •                                 end
  •                         else
  •                                 count <= count + 1'b1;
  •                 end
  • //dds IP核 ch1
  • //0.000001hz
  • dds1 dds_ch1(
  •   .ce(en), // input ce
  •   .clk(clk_50MHz), // input clk
  •   .sclr(ch1_sclr), // input sclr
  •   .pinc_in(ch1_pinc_in), // input [45 : 0] pinc_in
  •   .poff_in(ch1_poff_in), // input [45 : 0] poff_in
  •   .rdy(ch1_rdy), // output rdy
  •   .cosine(ch1_cosine), // output [13 : 0] cosine
  •   .sine(ch1_sine), // output [13 : 0] sine
  •   .phase_out(ch1_phase_out) // output [45 : 0] phase_out
  • );
  • //dds IP核 ch2
  • //0.000001hz
  • dds2 dds_ch2 (
  •   .ce(en), // input ce
  •   .clk(clk_50MHz), // input clk
  •   .sclr(ch2_sclr), // input sclr
  •   .pinc_in(ch2_pinc_in), // input [45 : 0] pinc_in
  •   .poff_in(ch2_poff_in), // input [45 : 0] poff_in
  •   .rdy(ch2_rdy), // output rdy
  •   .cosine(ch2_cosine), // output [13 : 0] cosine
  •   .sine(ch2_sine), // output [13 : 0] sine
  •   .phase_out(ch2_phase_out) // output [45 : 0] phase_out
  • );
  • endmodule


[color=rgb(0, 0, 0) !important]复制代码


  • `timescale 1ns / 1ps
  • //////////////////////////////////////////////////////////////////////////////////
  • // Company:
  • // Engineer:
  • //
  • // Create Date:    10:35:12 05/25/2020
  • // Design Name:
  • // Module Name:    da
  • // Project Name:
  • // Target Devices:
  • // Tool versions:
  • // Description:
  • //
  • // Dependencies:
  • //
  • // Revision:
  • // Revision 0.01 - File Created
  • // Additional Comments:
  • //
  • //////////////////////////////////////////////////////////////////////////////////
  • module da(
  •     input clk,            //FPGA clock
  •          input reset_n,
  •          output da1_clk,             //DA1 时钟信号
  •          output da1_wrt,             //DA1 数据写信号
  •          input [13:0]da1,
  •     output [13:0] da1_data,     //DA1 data
  •          output da2_clk,             //DA2 时钟信号
  •          output da2_wrt,                   //DA2 数据写信号
  •          input [13:0]da2,
  •     output [13:0] da2_data     //DA2 data
  •     );
  •         assign da1_clk=clk;
  •         assign da1_wrt=clk;
  •         assign da1_data=da1;
  •         assign da2_clk=clk;
  •         assign da2_wrt=clk;
  •         assign da2_data=da2;
  • endmodule


[color=rgb(0, 0, 0) !important]复制代码

  • `timescale 1ns / 1ps
  • //////////////////////////////////////////////////////////////////////////////////
  • // Company:
  • // Engineer:
  • //
  • // Create Date:    15:27:43 05/26/2020
  • // Design Name:
  • // Module Name:    top
  • // Project Name:
  • // Target Devices:
  • // Tool versions:
  • // Description:
  • //
  • // Dependencies:
  • //
  • // Revision:
  • // Revision 0.01 - File Created
  • // Additional Comments:
  • //
  • //////////////////////////////////////////////////////////////////////////////////
  • module top(
  •                 input clk_50MHz,                //时钟
  •                 input n_reset,                        //复位
  •                 //dac
  •                 output da1_clk,             //DA1 时钟信号
  •                 output da1_wrt,             //DA1 数据写信号
  •                 output [13:0] da1_data,     //DA1 data
  •                 output da2_clk,             //DA2 时钟信号
  •                 output da2_wrt,                   //DA2 数据写信号
  •                 output [13:0] da2_data     //DA2 data
  •     );
  • //da
  • wire [13:0] da_ch1;
  • wire [13:0] da_ch2;
  • //dds
  • wire signed[13:0] ch1_cosine;        //DDS1信号输出
  • wire signed[13:0] ch1_sine;
  • wire [45:0] ch1_phase_out;
  • wire ch1_rdy;
  • wire signed[13:0] ch2_cosine;        //DDS2信号输出
  • wire signed[13:0] ch2_sine;
  • wire [45:0] ch2_phase_out;
  • wire ch2_rdy;
  • //有符号数转无符号数
  • assign  da_ch1 = ch1_sine + 14'b10_0000_0000_0000;
  • assign  da_ch2 = ch2_sine + 14'b10_0000_0000_0000;
  • // 2ch 14bit DAC
  • da dac_2ch (
  •     .clk(clk_50MHz),
  •          .reset_n(n_reset),
  •     .da1_clk(da1_clk),
  •     .da1_wrt(da1_wrt),
  •     .da1(da_ch1),                 //混频滤波后输出
  •     .da1_data(da1_data),
  •     .da2_clk(da2_clk),
  •     .da2_wrt(da2_wrt),
  •     .da2(da_ch2),         //相位变化的信号
  •     .da2_data(da2_data)
  •     );
  • // 2ch 14bit DDS信号源
  • signal_source_2ch dds_2ch_signal_source (
  •     .clk_50MHz(clk_50MHz),
  •     .n_reset(n_reset),
  •     .en(1'b1),
  •     .ch1_cosine(ch1_cosine),
  •     .ch1_sine(ch1_sine),
  •     .ch1_phase_out(ch1_phase_out),
  •     .ch1_rdy(ch1_rdy),
  •     .ch2_cosine(ch2_cosine),
  •     .ch2_sine(ch2_sine),
  •     .ch2_phase_out(ch2_phase_out),
  •     .ch2_rdy(ch2_rdy)
  •     );
  • endmodule


[color=rgb(0, 0, 0) !important]复制代码


使用的是xilinx 的AX309开发板,和配套的AN9767 14位DAC,我这有两块AN9767,我都换上去试了一下,产生的波形是一样的,DDS ip核 我使用的是 V4.0 的DDS ip核

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /3 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-25 07:58 , Processed in 0.017010 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表