没有合适的资源?快使用搜索试试~ 我知道了~
首页verilog实现的UART(带中断、奇偶校验、帧错误)
资源详情
资源推荐
verilog实现的实现的UART(带中断、奇偶校验、帧错误带中断、奇偶校验、帧错误)
input wire clk, //50MHz input wire rst_n, input wire rx_in, //串行输入
verilog实现的UART,带中断、奇偶校验、帧错误
module uart_top
(
input wire clk, //50MHz
input wire rst_n,
input wire rx_in, //串行输入
outputwire intrrupt, //接收数据中断,已收到一个8bit的数据
outputwire tx //串行输出
);
parameter BPS9600 = 16'd5200; //50MHz时的计数值
parameter PARITY_EN = 1'b1; //无校验 PARITY_EN = 0,PARITY_ODD = 0,PARITY_EVEN = 0;
parameter PARITY_ODD= 1'b1; //奇校验 PARITY_EN = 1,PARITY_ODD = 1,PARITY_EVEN = 0;
parameter PARITY_EVEN = 1'b0; //偶校验 PARITY_EN = 1,PARITY_ODD = 0,PARITY_EVEN = 1;
wire bps_start; //接收数据bps开始标志
wire rx_bps_clk; //接收数据标志,在一个bit位的中点
wire tx_bps_clk; //发送数据标志,在一个bit位的起点
wire data_flag; //进入数据位(8位数据位)的标志
wire parity_flag; //进入校验位的标志
wire stop_flag; //进入停止位的标志
wire end_stop; //停止位结束标志
wire parity_enable; //校验使能标志
wire[7:0] rec_data; //接收到的8bit数据
wire bps_start1; //发送数据bps开始标志
wire data_flag1; //进入数据位(8位数据位)的标志
wire parity_flag1; //进入校验位的标志
wire stop_flag1; //进入停止位的标志
wire end_stop1; //停止位的标志
uart_bpsinst_rx_bps
(
.clk (clk ),
.rst_n (rst_n ),
.bps_set (BPS9600 ),
.bps_start (bps_start ),
.parity_enable(PARITY_EN ),
.rx_bps_clk (rx_bps_clk ),
.tx_bps_clk ( ),
.data_flag (data_flag ),
.parity_flag(parity_flag),
.stop_flag (stop_flag ),
.end_stop (end_stop )
);
uart_bpsinst_tx_bps
(
.clk (clk ),
.rst_n (rst_n ),
.bps_set (BPS9600 ),
.bps_start (bps_start1 ),
.parity_enable(PARITY_EN ),
.rx_bps_clk ( ),
.tx_bps_clk (tx_bps_clk ),
.data_flag (data_flag1 ),
.parity_flag(parity_flag1 ),
.stop_flag (stop_flag1 ),
.end_stop (end_stop1 )
);
uart_rx inst_uart_rx
(
.clk (clk ),
.rst_n (rst_n ),
.rx_in (rx_in ),
.rx_bps_clk (rx_bps_clk ),
.pari_odd (PARITY_ODD ),
weixin_38704565
- 粉丝: 6
- 资源: 944
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功