文档介绍:基于SOPC与PC机之间串行通信接口的设计
和大为
(陕西理工学院物理与电信工程学院通信101班,陕西汉中 723003)
指导教师:侯宝生
[摘要] 串口是用的非常多的一种接口,实现原理比较简单,基本所有CPU芯片都配置有串口,所以经常被用来作为调试接口。利用SOPC设计的与PC机之间串行通信接口包括NIOS2硬件模块和NIOS IDE软件模块。通过FPGA中的NIOS2系统硬件架构的UART模块,可以将SOPC系统与PC机进行连接,通过UART驱动程序控制,将预发数据经过串口发送到PC机上,实现CPU与PC机之间的串行数据通信。经测试,NIOS2系统能正常工作,采用115200波特率进行数据传输,接收数据与发送数据一致。
[关键词] 串口通信;SOPC;FPGA
[中图分类号] TN702 [文献标志码] A
The design of munication interface between SOPC and PC
He Dawei
(Grade10,Class1,Major munication Engineering,School of Physics and
munication Engineering of Shaanxi University of Technology, Hanzhong 723003,China)
Tutor:Hou Baosheng
[Abstract] Serial port is used as a interface very much, the realization principle is relatively simple, basically all the CPU chip is configured with a serial port, so it is often used as a debugging interface. Using SOPC design and PC machine munication interface includes NIOS2 module and NIOS module of IDEsoftware. Through the UART module of the NIOS2 system hardware architecturein FPGA, the SOPC system can be connected with PC machine, the UART drivercontrol, will advance data through the serial port is sent to the PC machine, the serial munication between CPU and PC machine. After testing, the NIOS2 system can work normally with 115200 baud rate, data transmission, data receiving and sending data consistency.
[Key words] munication;SOPC;FPGA
不要删除行尾的分节符,此行不会被打印
目录
基于SOPC与PC机之间串行通信接口的设计 I
The design of munication interface between SOPC and PC II
目录 1
1项目基本原理 2
串口通信 2
UART的基本特点 3
SOPC系统 3
2项目实现基本原则 4
FPGA  UART系统组成 4
波特率发生器 4
UART接收器 4
3实际系统设计 6
硬件系统设计 6
系统整体电路图 6
软件系统设计 7
4实验结果 10
5心得体会 11
结论 13
致谢 14
参考文献 15
附录A 16
附录B 17
附录C 20
附录D 22
1项目基本原理
串口通信
串口通信(munications)的概念非常简单,串口按位(bit)发送和接收字节。尽管比按字节(byte)的并行通信慢,但是串口可以在使用一根线发送数据的同时用另一根线接收数据。它很简单并且能够实现远距离通信。比如IEEE488定义并行通行状态时,规定设备线总长不得超过20米,并且任意两个设备间的长度不得超过2米;而对于串口而言,长度可达1200米。典型地,串口用于ASCII码字符的传输。通信使用3根线完成,分别是地线、发送、接收。由于串口通信是异步的,端口能够在一根线上发送数据同时在另一根线上接收数