基于USB接口的数据采集系统的设计与实现o
- 格式:pdf
- 大小:165.20 KB
- 文档页数:4
BI YE SHE JI(20 届)基于C8051F320的USB数据采集系统设计所在学院专业班级自动化学生姓名学号指导教师职称完成日期年月33中文摘要随着信息技术与电子技术的迅速发展,计算机和外围设备也得到讯速发展和应用,在科学研究领域和许多生产场合中常用到数据采集技术,并且对数据采集的要求越来越高。
以前的通信方式由于传送速率慢、抗扰能弱、安装复杂麻烦等原因,严重阻碍了数据采集技术的发展,而通用串行总线USB具有传输线少、速率快、支持热插拔和易于扩展等优点,很好得解决了上述产生的问题,因而串行总线技术在计算机系统及通信设备中迅速得到广泛的使用。
本设计以USB作为总线的采集系统为主要研究内容,利用C8051F320等芯片组成的一套数据采集系统的设计方案、开发方法和开发过程,并给出了具体实现方案。
文中首先介绍了设计中所用的C8051F320芯片的性能和特点,然后给出了具体硬件设计方案,并重点介绍了设计中应该注意的问题。
整个系统包括硬件设计和软件设计两部分,实现数据高速转换和采集、数据显示、数据保存等功能。
系统硬件部分实现数据采集功能,并将采集的数据送至USB控制器,再通过USB接口将数据传送给PC机。
硬件设计部分主要包括主控制器C8051F320外围电路设计与数据采集电路选择、键输入显示电路设计等。
硬件设计中每个单元部分之间的连接主要以芯片的工作模式和系统要实现的功能来决定。
系统软件包括USB固件程序设计、驱动程序设计以及用户界面程序。
USB固件程序在keil c中实现,实现C8051F320的初始化;驱动程序为用户提供了软件和硬件平台连接的通道;用户界面程序采用VB语言完成,调用了驱动函数句柄来对硬件进行操作,完成数据的接收、保存、以及显示功能。
关键词:C8051F320,USB,数据采集技术33AbstractWith the development of information technology and the rapid development of electronic technology, the computer and peripheral equipment also gets rapid development and application in the field of scientific research, production and many occasions are commonly used in the data acquisition technique, and the data acquisition of the various requirements are also getting higher and higher. The traditional means of communication as the transmission speed is slow, weak anti-jamming ability, troublesome installation and other reasons, has seriously hindered the development of the data acquisition equipment, a new generation of universal serial bus USB transmission line having small, fast, supports hot plug and easy to extend the advantages, is a very good solution to the above problems, so the serial bus technology in the computer system and the communications equipment quickly and has been widely used.This design is based on the USB bus data acquisition system as the main research content, using a C8051F320chip consisting of a set of data acquisition system design, development method and development process, and gives the concrete realization plan. This paper first introduced the design used in the C8051F320chip performance and characteristics, and then presents the concrete hardware design scheme, and introduces the design should pay attention to the problem. The whole system includes hardware design and software design in two parts, to realize high speed data conversion and acquisition, data display, data storage and other functions.The system hardware to realize the data acquisition function, and the data will be collected and sent to the USB controller, through the USB interface transmits the data to the PC machine. The hardware design mainly includes the main controller C8051F320 peripheral circuit design and data acquisition circuit selection, key input display circuit design. The hardware design of each33unit section is connected between the main chip working mode and system to achieve the function to decide. Each unit are given a unit circuit characteristics and use.System software includes USB firmware, device driver and user interface program. USB firmware program in keil C, C8051F320initialization; device driver for the user interface program provides software and hardware platform to connect the channels; the user interface program used VB language, in VB called driving function in the handle to the hardware equipment operation, realize the data receiving, storage, and display function.Finally, through the testing of the system, in the design of the data acquisition interface shows the random input signal waveform. Proved by practice, the system design has been initially successful, can achieve USB data acquisition function.Key Word:C8051F320、USB、The data acquisition technique33目录摘要 (I)ABSTRACT (Ⅱ)目录 (Ⅳ)第一章绪论 (1)1.1课题的背景和意义 (1)1.2数据采集系统发展史 (1)1.3数据采集技术发展方向 (2)1.4设计方案的可行性分析与预期目标 (3)第二章数据采集系统的整体设计 (4)2.1硬件系统构成 (4)2.2软件系统构成 (5)第三章硬件设计模块 (6)3.1数字温湿度传感器介绍 (6)3.1.1 接口说明 (7)3.1.2 发送命令 (7)3.1.3 测量时序 (8)3.1.4 通讯复位时序 (9)3.1.5 数据物理量转化 (9)3.1.6 温湿度传感器框图 (10)3.1.7 数据采集流程图 (11)3.2数据采集系统的主控芯片 (12)3.3单片机与主机连接设备USB (14)3.3.1 USB特点 (14)3.3.2 USB与IEEE 1394比较 (15)3.3.3 USB传输类型 (15)3.4单片机键盘显示接口模块 (16)3.4.1 键输入设定 (17)333.4.2 显示器电路设定 (19)3.5单片机辅助电路 (21)3.5.1 时钟电路 (21)3.5.1 复位电路 (21)第四章软件系统设计 (22)4.1主程序设计 (22)4.2固件程序设计 (23)4.3驱动程序设计 (26)4.4用户界面程序设计 (29)结论 (31)参考文献 (32)致谢 (33)33第一章绪论1.1 课题的背景和意义数据采集系统是将现场采集的数据进行处理、传输、显示、存储等操作,基于计算机测量的软硬件产品实现灵活的、用户自定义的测量系统,它主要完成数据的采集、模数转换、压缩处理,然后通过PC接口总线将处理后的数据送入计算机作进一步处理。
USB的数据采集系统设计分析0 引言地质雷达从 20 世纪初,随着电子技术的发展,其功能和技术指标得到极大的提高,如利用高频天线进行公路面层厚度检测时,垂向分辨率可达到毫米级,利用低频天线探测深层目标时,探测深度可达到几十米。
如今,随着地质雷达在考古、市政建设、建筑、铁路等各个领域的广泛应用,地质雷达的数据处理方法也在不断地进步。
随着信息技术的飞速发展,各种数据的实时采集和处理在现代工业控制中已成为必不可少的。
这就为我们的设计提出了两个方面的要求:一方面,要求接口简单灵活且有较高的数据传输率;另一方面,由于数据量通常都较大,要求主机能够对实时数据做出快速响应,并及时进行分析和处理。
随着信息化带动工业化进程的逐步深入,电子计算机信息技术的不断发展和完善,采用单片机实现的数据采集系统的应用越来越多。
随着工业化的进步,以前传统的采用人工进行数据记录登记已经远远不能满足现在工业化生产的要求,而采用通用数据总线USB 连接单片机实现的数据采集系统具有自动化和无人值守等特点,使得它们在许多应用场合得到了广泛的应用。
本文采用的是EZ-USB FX2LP 的CY7C68013 芯片,以USB 为研究对象,结合大型复杂的可编程器件(CPLD),设计USB 总线接口,构成基于PC 机的数据采集系统,最终实现多通道、高速的数据采集。
1 通用串行总线USBUSB(Universal Serial Bus 通用串行总线)是一种计算机和外部设备进行通信连接的新型接口,最早于1994 年11 月,由康柏、微软、IBM、DEC 等公司共同提出[1]。
USB 具有连接方便,无需外接电源,即插即用,支持热插拔,动态加载驱动程序等特有优点,在主机和数据采集系统之间可以实现简单、快捷、可靠的连接和通讯。
所以,基于USB 总线的数据采集方式非常适用于数据采集系统,已逐渐成为现代数据传输的发展趋势。
1.1 USB 总线特性USB 是一种高效、快速、价格低廉、体积小和支持热插拔的新型串行通信接口。