欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
FPGA采集模擬信號(hào)數(shù)據(jù)波形,51單片機(jī)顯示波形
[打印本頁(yè)]
作者:
siyu
時(shí)間:
2018-4-1 13:37
標(biāo)題:
FPGA采集模擬信號(hào)數(shù)據(jù)波形,51單片機(jī)顯示波形
fpga采集數(shù)據(jù)波形,51單片機(jī)顯示波形,示波器
0.jpg
(42.45 KB, 下載次數(shù): 71)
下載附件
2018-4-1 21:08 上傳
單片機(jī)源程序如下(frqent_count.v):
/*==============================================
* 描 述:頻率計(jì)控制模塊計(jì)數(shù)測(cè)試程序
//==============================================*/
module frqent_count(clk_b,clk_d,vavle,rst,cnt_h_out,cnt_b_out,cnt_d_out);
input rst;
input clk_b;
input clk_d;
input vavle;
output reg[31:0] cnt_h_out; //用于測(cè)量高脈寬
output reg[31:0] cnt_b_out; //標(biāo)準(zhǔn)頻率計(jì)數(shù)
output reg[31:0] cnt_d_out; //待測(cè)頻率計(jì)數(shù)
reg [31:0] cnt_h; //用于測(cè)量高脈寬
reg [31:0] cnt_b; //標(biāo)準(zhǔn)頻率計(jì)數(shù)
reg [31:0] cnt_d; //待測(cè)頻率計(jì)數(shù)
reg start_reg; //開(kāi)始信號(hào)緩存
reg clk_d_reg; //待測(cè)時(shí)鐘緩存
wire start;
/*------------------------------------------------
* 模塊說(shuō)明:計(jì)數(shù)允許模塊
* 備 注:Start_l對(duì)于頻率沒(méi)有作用,只對(duì)于低電平
脈寬計(jì)數(shù)有作用,頻率主要作用在Start
*-------------------------------------------------*/
assign start = vavle;
//開(kāi)始信號(hào)緩存
always@(posedge clk_b,negedge rst)
begin
if(!rst)
begin
start_reg <= 1'b0;
end
else
begin
start_reg <= start;
end
end
//待測(cè)信號(hào)緩存
always@(posedge clk_b, negedge rst)
begin
if(!rst)
begin
clk_d_reg <= 1'b0;
end
else
begin
clk_d_reg <= clk_d;
end
end
//待測(cè)時(shí)鐘進(jìn)行計(jì)數(shù)
always@(posedge clk_d,negedge rst)
begin
if(!rst)
begin
cnt_d <= 32'b0;
end
else
begin
if(start == 0)
begin
cnt_d <= 0;
end
// 高電平觸發(fā)
else
begin
cnt_d <= cnt_d + 1'b1;
end
end
end
//標(biāo)準(zhǔn)時(shí)鐘進(jìn)行計(jì)數(shù)
always@(posedge clk_b,negedge rst)
begin
if(!rst)
begin
cnt_b <= 0;
end
else
begin
if(start == 0)
begin
cnt_b <= 0;
end
else
begin
cnt_b <= cnt_b + 1'b1;
end
end
end
//高電平計(jì)數(shù)
always@(posedge clk_b, negedge rst)
begin
if(!rst)
begin
cnt_h <= 0;
end
else
begin
if(clk_d == 0)
begin
cnt_h <= 0;
end
else
begin
cnt_h <= cnt_h + 1'b1;
end
end
end
//標(biāo)準(zhǔn)計(jì)數(shù)和待測(cè)計(jì)數(shù)輸出
always@(posedge clk_b, negedge rst)
begin
if(!rst)
begin
cnt_b_out <= 0;
cnt_b_out <= 0;
end
else
begin
if(start_reg && !start)
begin
cnt_b_out <= cnt_b;
cnt_d_out <= cnt_d;
end
else
begin
cnt_b_out <= cnt_b_out;
cnt_d_out <= cnt_d_out;
end
end
end
//高電平計(jì)數(shù)輸出
always@(posedge clk_b,negedge rst)
begin
if(!rst)
begin
cnt_h_out<=0;
end
else
begin
if(clk_d_reg&&!clk_d)
begin
cnt_h_out<=cnt_h;
end
else
begin
cnt_h_out<=cnt_h_out;
end
end
end
endmodule
復(fù)制代碼
所有資料51hei提供下載:
采集模擬信號(hào).rar
(2.39 MB, 下載次數(shù): 51)
2018-4-1 13:35 上傳
點(diǎn)擊文件名下載附件
fpga 采集數(shù)據(jù) 51顯示波形
下載積分: 黑幣 -5
作者:
十三當(dāng)家
時(shí)間:
2018-5-10 10:44
有用,就是黑幣太高了
作者:
十三當(dāng)家
時(shí)間:
2018-5-10 10:45
學(xué)習(xí)學(xué)習(xí)
作者:
yzkn
時(shí)間:
2018-8-6 00:45
謝謝。。。。。。。。。。。。
歡迎光臨 (http://m.raoushi.com/bbs/)
Powered by Discuz! X3.1