45.简易DDS信号发生器的设计与验证(4)

(1)为了方便,不如把VIO ip核搬移到顶层模块,修改核心模块,将它的频率控制字作为输入引出。

(2)顶层模块代码:

module dds_top
(
    input               clk         ,
    input               reset_n     ,
    input   [3:0]       key         ,
    
    output  [7:0]       data_out    ,
    output              dac_clk     
    
);

    assign  dac_clk = ~clk;
      
/*
    Fout = ford * Fclk /  2 ^ 32;
    则 ford = Fout * 2^32 / Fclk;
    Fclk = 50_000_000;
    ford = Fout * 85.89934592
    如果想要输出一个1MHz的正弦波则设置fword = 85899346
    
*/
    wire    [31:0]      fword           ;
    wire    [3:0]       wave_selcet     ;
    
key_ctrl key_ctrl_inst0
(
    .clk         (clk        ),
    .reset_n     (reset_n    ),
    .key         (key        ),
                             
    .wave_selcet (wave_selcet)
);    

vio_fword vio_fword_inst (
  .clk                  (clk),                // input wire clk
  .probe_out0           (fword)             // output wire [31 : 0] probe_out0
); 

dds_core dds_core_inst0
(
    .clk         (clk        ),
    .reset_n     (reset_n    ),
    .wave_selcet (wave_selcet),
    .fword        (fword      ),

    .data_out    (data_out   )
);

endmodule

(3)引脚绑定:

set_property IOSTANDARD LVCMOS33 [get_ports {key[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports clk]
set_property IOSTANDARD LVCMOS33 [get_ports dac_clk]
set_property IOSTANDARD LVCMOS33 [get_ports {data_out[0]}]
set_property IOSTANDARD LVCMOS33 [get_ports {data_out[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {data_out[2]}]
set_property IOSTANDARD LVCMOS33 [get_ports {data_out[3]}]
set_property IOSTANDARD LVCMOS33 [get_ports {data_out[4]}]
set_property IOSTANDARD LVCMOS33 [get_ports {data_out[5]}]
set_property IOSTANDARD LVCMOS33 [get_ports {data_out[6]}]
set_property IOSTANDARD LVCMOS33 [get_ports {data_out[7]}]
set_property IOSTANDARD LVCMOS33 [get_ports {key[1]}]
set_property IOSTANDARD LVCMOS33 [get_ports {key[2]}]
set_property IOSTANDARD LVCMOS33 [get_ports {key[3]}]
set_property IOSTANDARD LVCMOS33 [get_ports reset_n]
set_property PACKAGE_PIN W19 [get_ports clk]
set_property PACKAGE_PIN U22 [get_ports dac_clk]
set_property PACKAGE_PIN P19 [get_ports {data_out[0]}]
set_property PACKAGE_PIN R19 [get_ports {data_out[1]}]
set_property PACKAGE_PIN N13 [get_ports {data_out[2]}]
set_property PACKAGE_PIN N14 [get_ports {data_out[3]}]
set_property PACKAGE_PIN M18 [get_ports {data_out[4]}]
set_property PACKAGE_PIN L18 [get_ports {data_out[5]}]
set_property PACKAGE_PIN N18 [get_ports {data_out[6]}]
set_property PACKAGE_PIN N19 [get_ports {data_out[7]}]
set_property PACKAGE_PIN V17 [get_ports {key[0]}]
set_property PACKAGE_PIN W17 [get_ports {key[1]}]
set_property PACKAGE_PIN AA18 [get_ports {key[2]}]
set_property PACKAGE_PIN AB18 [get_ports {key[3]}]
set_property PACKAGE_PIN N15 [get_ports reset_n]

(4)实验现象:

板卡连线情况:

(2)VIO界面调试频率:

计算并将频率改成5000Hz

通过按键,切换成方波、三角板、锯齿波

调整频率为20KHz

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-20 12:58:02       57 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-20 12:58:02       60 阅读
  3. 在Django里面运行非项目文件

    2024-07-20 12:58:02       48 阅读
  4. Python语言-面向对象

    2024-07-20 12:58:02       60 阅读

热门阅读

  1. TFHE库,fftw和googletest库安装

    2024-07-20 12:58:02       20 阅读
  2. 车端平行驾驶通信模块弱网报警梳理

    2024-07-20 12:58:02       17 阅读
  3. 设计模式七大原则(五)迪米特法则

    2024-07-20 12:58:02       15 阅读
  4. 常用设计模式

    2024-07-20 12:58:02       18 阅读
  5. 三种著名兵器

    2024-07-20 12:58:02       18 阅读
  6. 达梦+flowable改造

    2024-07-20 12:58:02       20 阅读
  7. 杀毒软件对比

    2024-07-20 12:58:02       19 阅读