鉴于大家对电子数电单片机十分关注,我们编辑小组在此为大家搜集整理了“I2C总线数据传输应用研究(硬件部分)”一文,供大家参考学习!
论文编号:JD505 论文字数:8844,页数:18
摘要
I2C总线是Philips公司推出的串行总线,整个系统仅靠数据线(SDA)和时钟线(SCL)实现完善的全双工数据传输,即CPU与各个外围器件仅靠这两条线实现信息交换。I2C总线系统与传统的并行总线系统相比具有结构简单、可维护性好、易实现系统扩展、易实现模块化标准化设计、可靠性高等优点。
本论文主要阐述了用单片机扩展的I2C总线与各种带有I2C总线器件之间的数据传输问题。本设计采用AT89S51单片机的两个I/O口扩展I2C总线,整个系统由温度传感器,信号采集电路、键盘、显示电路、E2PROM读写电路构成。本系统可以采集周围环境温度,也可以通过键盘设置警界温度,便在LCD上显示环境温度和警界温度。单片机通过I2C总线可以读写E2PRPOM,便显示存储内容。
硬件方面,周围环境温度的测量采用AD590温度传感器,信号采集的A/D模块采用了带有I2C接口的飞利浦公司的PCF8591芯片;键盘、显示分别采用了点触式按键和带有字库128*64LCD显示.由于没有找到带有I2C接口的LCD,我们同样采用了带有I2C接口的飞利浦公司的PCF8574芯片,用于控制LCD显示。外存扩展我们采用E2PROM芯片,是容量为4K的AT24C04。软件设计采取了流行的模块化编程方法和模块调试,软件程序的开发全部采用C语言。其主要包含的程序有:主程序、I2C扩展程序、键盘扫描子程序、A/D采样子程序、LCD显示子程序等。
本设计的优点是简单的两线串行I2C总线将互联减到最小,因此IC的管脚更少而且PCB的线路也减少,使硬件效益最大电路最简单。
关键词:I2C总线,串行总线,总线扩展
I2C BUS DATA TRANSMISSION APPLIED RESEARCH (HARDWARE PART)
Abstract
The I2C bus is the serial bus which Philips corporation promotes. The overall system only depends on the data line (SDA) and the clock line (SCL) realizes the consummation full-duplex data transmission. Namely CPU only depends on these two lines with each periphery component to realize the exchange of information. The I2C bus system compares with the traditional parallel bus system has the simple structure, the good maintainability, easy to realize the system to expand, realize the modular standardization design, the reliable higher merit.
The present paper mainly elaborated the data transmission question between the I2C bus components by the I2C bus which expands by single chip microcomputer. This design uses AT89S51 single chip microcomputer''s two I/O mouth to expand the I2C bus. Overall system is constituted by temperature sensor, signal gathering electric circuit, keyboard, display circuit, E2PROM reading-writing electric circuit. This system may gather the environment temperature, may also establish the police temperature through the keyboard, then demonstrates the ambient temperature and the police temperature on LCD. The single chip microcomputer may read or write E2PRPOM through the I2C bus, then demonstrate the store content.
As far as the design of the hardware is concerned, we chose AD590 as the temperature sensor to gather the environment temperature, and chose Phillips Corporation''s PCF8591 with the I2C bus mouth as A/D conversion to operate the gathering single, the touching style key as the keyboard, 128*64LCD with Chinese fonts as the monitor display. Because we has not found has I2C connection LCD, we also used Phillips Corporation''s PCF8574 chip with the I2C bus in controlling the LCD demonstration. We use the E2PROM AT24C04 chip as the external memory, whose capacity is 4K. The development of software adopts the popular modularized structure and the modularized debug facilities. The design of software adopts assembly C language entirely. The primary program is composed of main program, I2C expansion procedure, keyboard scanning subroutine, A/D sampling subroutine, LCD demonstration subroutine and so on.
The advantage of the design is that the I2C bus make electric circuit more simple. therefore the chip’s pin will be less moreover the PCB line also to reduce, causes the hardware benefit biggest and electric circuit simple.
Key words: I2Cbus,data bus,bus expansion
目录
摘要 I
Abstract II
第1章 绪论 3
1.1 I2C总线介绍 3
1.2 I2C总线特征 3
1.2.1 I2C总线的优点 3
1.2.2 I2C总线在系统开发中的作用 4
1.2.3 I2C总线的一般应用特性 4
1.3 课题指导思想 5
1.4 课题设计任务和要求 5
1.5 论文结构 6
第2章 I2C总线协议 7
2.1 起始和停止条件 7
2.2 响应 7
2.3 仲裁和时钟发生 8
2.3.1 同步 8
2.3.2 仲裁 9
2.4 七位的地址格式 10
2.5 本章小节 11
第3章 系统设计思想及主要应用器件 13
3.1 系统设计的总体思想 13
3.2 系统硬件简介 13
3.2.1 硬件设计思想 13
3.2.2 硬件构成 14
3.3 系统主要器件 14
3.3.1 PCF8591 14
3.3.2 PCF8574 15
3.3.3 LCD 16
3.3.4 E2PROM 18
3.4 模块设计 18
3.4.1 键盘模块 18
3.4.2 温度采集模块 21
3.4.3 LCD控制模块 22
3.4.4 E2PROM 23
3.5 本章小结 23
第4章 系统软件设计 25
4.1 系统软件设计要解决的问题 25
4.2 系统软件模块 25
4.2.1 单片机扩展I2C总线 25
4.2.2 A/D转换模块 28
4.2.3 键盘 29
4.2.4 LCD显示模块 32
4.2.5 E2PROM的读写 34
4.3 本章小节 36
结论 37
谢辞 39
参考文献 39