QQ截圖20190616143508.png (138.19 KB, 下載次數: 56)
下載附件
仿真圖,
2019-6-25 11:31 上傳
0.png (8.52 KB, 下載次數: 64)
下載附件
2019-6-25 17:32 上傳
單片機源程序如下:
- module fsk_freq_ctrl(clk,data_in,freq_ctrl,rst);
- input clk;
- input [7:0] data_in;
- input rst;
- output [11:0] freq_ctrl;
- //reg [4:0] q;
- //parameter i;
- reg [4:0] i;
- wire [4:0] q;
- reg [11:0] freq_ctrl;
- reg [7:0] a;
- always @(posedge clk or negedge rst)
- if(rst==1'b0)
- begin
- a <= data_in;
- freq_ctrl <=12'b000000000000;
- end
- else if(a[i]!=0)
- begin
- freq_ctrl <= 12'd20;
- end
- else if(a[i]==0)
- freq_ctrl <= 12'd10;
-
- always @(posedge clk or negedge rst)
- if(!rst)
- i=5'b0;
- else if(i==5'd7)
- begin
- i <= 5'b0; end
- else i <= i+1;
- endmodule
- //for(i=0;i<8;i=i+1)
- // if(data_in[i]==0)
- // freq_ctrl=12'd10;
- // else
- // freq_ctrl=12'd20;
復制代碼
具體操作流程可參考公號里的步驟
qrcode_for_gh_0305c94886bb_258.jpg (26.38 KB, 下載次數: 61)
下載附件
參考公眾號
2019-6-25 11:33 上傳
所有資料51hei提供下載:
rand.zip
(8.6 MB, 下載次數: 29)
2019-6-25 11:32 上傳
點擊文件名下載附件
工程源文件 下載積分: 黑幣 -5
|