云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 基于FPGA的温度监控系统 - 图文

基于FPGA的温度监控系统 - 图文

  • 62 次阅读
  • 3 次下载
  • 2025/5/4 23:45:10

山东科技大学学士学位论文 附录

dq_out <= data_w[cnt_bit]; end else if(cnt < 'd65) begin link <= 0; end else begin cnt <= 0; cnt_bit <= cnt_bit + 1; if(cnt_bit == 'd7) begin cnt_bit <= 0; state <= WAIT_800MS; end end end

WAIT_800MS: begin cnt <= cnt + 1; if(cnt == 'd800000) begin cnt <= 0; state <= RESET2; end end

RESET2: begin cnt <= cnt + 1; if(cnt < 'd500) begin link <= 1; dq_out <= 0; end else if(cnt < 'd1000) begin link <= 0; end else begin cnt <= 0;

state <= WRITE_CC2;

41

//等待800ms //第二次复位 山东科技大学学士学位论文 附录

data_w <= 8'hcc; cnt_bit <= 0; end end

WRITE_CC2: begin //吸入跳过rom命令 cnt <= cnt + 1; if(cnt < 'd5) begin link <= 1; dq_out <= 0; end else if(cnt < 'd60) begin dq_out <= data_w[cnt_bit]; end else if(cnt < 'd65) begin link <= 0; end else begin cnt <= 0; cnt_bit <= cnt_bit + 1; if(cnt_bit == 'd7) begin state <= WRITE_BE; cnt_bit <= 0; data_w <= 8'hbe; end end end

WRITE_BE: begin cnt <= cnt + 1; if(cnt < 'd5) begin link <= 1; dq_out <= 0; end

else if(cnt < 'd60)

42

//写入读数据命令 山东科技大学学士学位论文 附录

begin dq_out <= data_w[cnt_bit]; end else if(cnt < 'd65) begin link <= 0; end else begin cnt <= 0; cnt_bit <= cnt_bit + 1; if(cnt_bit == 'd7) begin state <= READ1; cnt_bit <= 0; end end end

READ1: begin cnt <= cnt + 1; if(cnt < 'd3) begin link <= 1; dq_out <= 0; end else if(cnt == 'd3) link <= 0; else if(cnt == 'd12) data_r[cnt_bit] <= dq_in; else if(cnt > 'd65) begin cnt <= 0; cnt_bit <= cnt_bit + 1; if(cnt_bit == 'd7) begin cnt_bit <= 0; temp[7:0] <= data_r; state <= READ2;

end

43

//读入第一个字节 山东科技大学学士学位论文 附录

end end READ2:

begin //读入第二个字节 cnt <= cnt + 1; if(cnt < 'd3) begin link <= 1; dq_out <= 0; end else if(cnt == 'd3) link <= 0; else if(cnt == 'd12) data_r[cnt_bit] <= dq_in; else if(cnt > 'd65) begin cnt <= 0; cnt_bit <= cnt_bit + 1; if(cnt_bit == 'd7) begin cnt_bit <= 0; temp[15:8] <= data_r; state <= RESET1; end end end endcase end

endmodule 分频模块: module clk_gen( input rst, input clk, output reg clk_1k, output reg clk_1m ); reg[14:0] cnt_1k;

44

搜索更多关于: 基于FPGA的温度监控系统 - 图文 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

山东科技大学学士学位论文 附录 dq_out <= data_w[cnt_bit]; end else if(cnt < 'd65) begin link <= 0; end else begin cnt <= 0; cnt_bit <= cnt_bit + 1; if(cnt_bit == 'd7) begin cnt_bit <= 0; state <= WAIT_800MS; end end end WAIT_800MS: begin

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com