![](https://csdnimg.cn/release/download_crawler_static/86557929/bg1.jpg)
用 DAC 实现电压信号检测
实验原理:
利用 DAC0832 产生的正斜率斜波接到运放的正输入端,可调电位器的输出电压接到运放的
负输入端,运放输出端信号引到 CPLD 器件所对应的输入检测管脚。最后通过 CPLD 将被测
电压显示到数码管上。
实验程序:
Verilog 程序如下:
module top(ckscn, reset, clkdsp, jmp, a, b, c, d, e, f, g, daout, sel);
input ckscn;
input reset;
input clkdsp;
input jmp;
output a;
output b;
output c;
output d;
output e;
output f;
output g;
output [7:0] daout;
output [1:0] sel;
wire clkin1, clkin2;
wire [10:0] data1, data2;
wire [3:0] data3;
assign clkin1 = ckscn;
assign clkin2 = clkdsp;
checoutvalue u1(.reset(reset), .jump(jmp), .d_in(data1), .d_out(data2));
signalvalue u2(.clk(clkin1), .reset(reset), .d_out(data1));
wavegenerator u3(.clk(clkin1), .reset(reset), .daout(daout));
xdeled u4(.d_in(data3), .a(a), .b(b), .c(c), .d(d), .e(e), .f(f), .g(g));
displayvalue u5(.clk(clkin2), .d_in(data2), .d_out(data3), .sel(sel));
endmodule
//检测模块
module checoutvalue(reset, jump, d_in, d_out);
input reset, jump;
input [10:0] d_in;
output reg [10:0] d_out;
评论0