1、 本 科 学 生 毕 业 论 文 2011 年 5 月 28 日 论文题目: 基于 FPGA 的串口通信电路设计 学 院: 电子工程学院 年 级: 专 业: 集成电路设计与集成系统 姓 名: 学 号: 指导教师: I 摘要 串行通信接口是一种应用广泛的通信接口。 目前,大部分处理器都集成了支 持 RS-232 接口 (又称 EIA RS-232-C) 的通用异步收发器 (Universal Asynchronous Receiver/Transmitter,UART),本文设计了一个串口数据采集和处理程序,详 细介绍了用 Verilog HDL 硬件描述语言来开发波特率发生器、接收模块和发送模
2、 块这三个模块,以及系统各个模块的具体设计方法和原理,用 Quartus II 软件进 行仿真并给出结果,分别验证各个模块的正确性。本设计还使用基于 ALTERA 公司的 Cyclone II EP2C5T144 芯片的 FPGA 开发板,在 FPGA 开发板上实现和 PC 通过串口调试软件完成双向通信,不仅要求将开发板的数据显示在 PC 的串 口调试助手软件上,还要求用 PC 发送数据的 ASCII 码来驱动电路的 8 个 LED 灯,验证用 FPGA 实现串行通信的可行性。 关键词 串行通信;RS-232;UART;Verilog HDL;FPGA II Abstract Serial c
3、ommunication interface is a widely used communication interface. At present, most of processor integrated RS-232(EIA RS-232-C) interface to support UART (Universal Asynchronous Receiver/Transmitter) communication, This thesis design a data acquisition and treatment program. Besides that, the thesis
4、introduced Baud Rate Generator module、Receiver module、Send module based on language Verilog HDL and give the results by simulate in Quartus II software. This design also uses EP2C5T144 FPGA chip to achieve the two-way communication by simulate with Quartus II and PC through the serial port debugging
5、 software. Not only requires the development boards data displayed in the PCs serial port debugging software, also ask ASCII data sent by PC Code to drive eight LED lights, meanwhile verified the serial communication with FPGA. Key words Serial communication; RS-232; UART; Verilog HDL; FPGA 目录 摘要I A
6、bstract . II 第 1 章 语言和工具 1 1.1 V erilog HDL 语言概述 . 1 1.2 FPGA 概述 3 1.3 Quartus II 软件介绍 . 7 1.4 FPGA 开发板介绍 . 8 1.5 本章小结 .11 第 2 章 串口通信协议简介 12 2.1 串口通信接口 . 12 2.2 RS232 通信协议 12 2.3 串口通信时序分析 14 2.4 本章小结 15 第 3 章 串口通信的 V erilog HDL 实现 . 16 3.1 设计功能说明 . 16 3.2 波特率发生器模块的 V erilog HDL 实现 16 3.3 发送模块的 V erilog HDL 实现 18 3.4 接收模块的 V erilog HDL 实现 24 3.5 本章小结 30 第 4 章 串口通信的硬件调试 31 4.1 板级调试说明 . 31 4.2 下载配置 FPGA. 32 4.3 配置串口调试软件 34 4.4 调试结果 34 4.5 本章小结 37 结论. 38 参考文献 39 附录 1 波特率发生器 V erilog HDL