i2c串行总线的模拟与仿真

更新时间:2023-11-10 23:06:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

本科学生毕业论文

论文题目: 学 院: 年 级: 专 业: 姓 名: 学 号: 指导教师:

I2C串行总线的模拟与仿真

电子工程学院 2008级

集成电路设计与集成系统 刘欣 20083410 胡靖

2012年5月20日

摘要

本论文主要研究的是I2C串行总线的模拟与仿真。首先,在论文的开始介绍了数字电子设计的发展过程,表明了数字电子设计在现在的生活中占有十分重要的地位。其次,介绍了I2C串行总线协议相关概念等内容,为总体的设计理清思路做铺垫,防止由于概念混淆而引起的不必要的麻烦。然后,介绍了整体设计的一个设计流程,防止在设计时陷入死循环的误区,此流程为设计提供了一个向导作用。最后,通过Xilinx公司开发的Xilinx ISE 10.1软件进行程序的模拟过程,同时在Xilinx ISE 10.1软件中调用Modelsim SE 6.5软件,观察仿真结果图。

通过观察串行数据线(SDA)和串行时钟线(SCL)在仿真软件Modelsim SE 6.5中波形图的高低电平变化并读出数据,判断本论文的设计是否满足最初的设计初衷,是否符合设计要求。

关键词

I2C总线;现场可编程门阵列;硬件描述语言;ModelSim

I

Abstract

In this paper the study of simulation and emulation of the I2C serial bus is mainly discussed. First of all, in the beginning of the thesis describes the development of digital electronic design, digital electronic design that occupies a very important position in the present life. Secondly, presents the concept of the I2C serial bus, clarify the ideas for the overall design to prevent unnecessary trouble caused as a result of conceptual confusion. Then, presents the design process to prevent an infinite loop errors, this process is designed to provide a wizard role. Finally, the simulation program developed by Xilinx, Inc. Xilinx ISE 10.1 software, calling the Modelsim SE 6.5 software, and observe the simulation results in Figure Xilinx ISE 10.1 software.

Through the serial data line (SDA) and serial clock line (SCL) in the simulation software of Modelsim SE 6.5, the high and low change of the waveform and read data, determine the design of this thesis is meet the originally designed, and whether the design fit the requirements.

Key words

I2C bus; FPGA; HDL; ModelSim

II

目录

摘要 ............................................................................................................................................ I Abstract ................................................................................................................................... II

前言 ........................................................................................................................................... 1 第一章 数字电子设计概述 ..................................................................................................... 2

1.1数字电子设计发展概况 ............................................................................................. 2 1.2硬件描述语言 ............................................................................................................. 3 1.3 Verilog HDL的发展与特点...................................................................................... 4 1.4可编程逻辑器件综述 ................................................................................................. 4

1.4.1 FPGA简介 ...................................................................................................... 5 1.4.2 FPGA设计流程 .............................................................................................. 5 1.5 Xilinx ISE开发系统简介 .......................................................................................... 6 1.6 本章小结 ..................................................................................................................... 6 第二章 I2C总线的解析 ........................................................................................................... 7

2.1 I2C总线的概述 .......................................................................................................... 7 2.2 I2C协议的基本概念 .................................................................................................. 7

2.2.1主节点和从节点 .............................................................................................. 8 2.2.2总线上节点的寻址方式 .................................................................................. 8 2.3 I2C协议的时序要求 ................................................................................................... 9

2.3.1总线上数据传递时序 ...................................................................................... 9 2.3.2总线上的时序信号 ........................................................................................ 10 2.4 本章小结 .................................................................................................................. 11 第三章 模拟I2C接口程序的基本框架 ................................................................................ 12

3.1基本框架 ................................................................................................................... 12 3.2各个框架的内容 ....................................................................................................... 12 3.3 本章小结 .................................................................................................................. 15 第四章 I2C总线协议的代码实现与仿真 ............................................................................. 16

4.1 I2C总线协议的代码实现 ........................................................................................ 16

4.1.1位传输的代码实现 ........................................................................................ 16 4.1.2字节传输的代码实现 .................................................................................... 17 4.1.3程序主体的代码实现 .................................................................................... 19 4.1.4 综合结果 ....................................................................................................... 20 4.2程序的仿真代码的实现 ........................................................................................... 22

4.2.1主节点的仿真代码实现 ................................................................................ 22 4.2.2从节点的仿真代码实现 ................................................................................ 23 4.2.3仿真主程序的代码实现 ................................................................................ 24 4.2.4仿真结果 ........................................................................................................ 25 4.3 本章小结 .................................................................................................................. 27 结论 ......................................................................................................................................... 28 参考文献 ................................................................................................................................. 29 附录 ......................................................................................................................................... 31 致谢 ......................................................................................................................................... 37

本文来源:https://www.bwwdw.com/article/xx0v.html

Top