基于CYCLONE2 FPGA设计的频率计+串口通信实验quartus9.0工程源码+文档说明资料, /******************************************************************************* ** 文件名称:uart.v ** 功能描述:串口通信__FPGA和上位机通信(波特率:9600bps,10个bit是1位起始位,8个数据位,1个结束) *******************************************************************************/ module uart( clk, rst, rxd, txd, start, data_cnt, count1, count2, count3, count4, count5, count6, count7, count8, send_finish ); input clk; //系统50MHZ时钟 input rst; //复位 input rxd; //串行数据接收端 output txd; //串行数据发送端 input start; //开始采集信号 input[3:0] data_cnt; //数据位标志 output send_finish; //发送完成标志 input [7:0] count1; input [7:0] count2; input [7:0] count3; input [7:0] count4; input [7:0] count5; input [7:0] count6; input [7:0] count7; input [7:0] count8; reg[15:0] div_reg; //分频计数器,分频值由波特率决定。分频后得到频率8倍波特率的时钟 reg[2:0] div8_tras_reg; //该寄存器的计数值对应发送时当前位于的时隙数 reg[3:0] state_tras; //发送状态寄存器 reg clkbaud_tras; //以波特率为频率的发送使能信号 reg clkbaud8x; //以8倍波特率为频率的时钟,它的作用是将发送或接受一个bit的时钟周期分为8个时隙 reg trasstart; //开始发送标志 reg send_finish; reg txd_reg; //发送寄存器 reg[7:0] rxd_buf; //接受数据缓存 reg[7:0] txd_buf; //发送数据缓存 reg[3:0] send_state; //发送状态寄存器 parameter div_par=16'h145; //分频参数,其值由对应的波特率计算而得,按此参数分频的时钟频率是波倍特率的8 //倍,此处值对应9600的波特率,即分频出的时钟频率是9600*8 (CLK50M) assign txd = txd_reg; // assign send_state=data_cnt; /*******分频得到8倍波特率的时钟*********/ always@(posedge clk ) begin if(!rst) div_reg<=0; else begin if(div_reg==div_par-1'b1) div_reg<=0; else div_reg<=div_reg+1'b1; end end always@(posedge clk) begin if(!rst) clkbaud8x<=0; else if(div_reg==div_par-1'b1) clkbaud8x<=~clkbaud8x;//分频得到8倍波特率的时钟:clkbaud8x end // *******************************/ always@(posedge clkbaud8x or negedge rst)//clkbaud8x
FPGA串口通信(Verilog编写)
2021-11-25 09:05:16 5.31MB FPGA verilog
1
用FPGA进行串口通信的代码编写,可以在modelsim上进行仿真
2021-11-12 07:26:11 6.61MB FPGA串口通信
1
串口更新FPGA程序方案,已验证
2021-10-29 10:53:23 304KB Flash配置 xilinxA7 FPGA串口更新
1
FPGA串口收发字符串之串口调度字符,有需要的同学可以下载!
2021-10-19 19:14:43 7KB FPGA串口 发送调度 串口HMI屏
1
labview读取串口(子VI).vi
2021-08-21 09:40:37 13KB labview dsp fpga 串口通信
1
FPGA 串口多字节发送,ModelSIM仿真
2021-08-11 17:18:07 6.08MB FPGA 串口通信 多字节发送 modelSIM仿真
1
FPGA串口多字节收发,含modelsim仿真
2021-08-11 17:17:55 6.78MB fpga 串口通信
1
FPGA 串口多字节接收,并对接收数据进行解码,modelsim仿真
2021-08-10 09:07:35 6.59MB fpga 串口通信 多字节接收 modelsim仿真
1
FPGA 实现按键的长短按,并通过串口发送不同的码值
1