基于FPGA的环境测试仪系统的设计 THE ANALYSIS AND DESIGN OF ENVIRONMENTAL TEST SYSTEMS
BASED ON FPGA
专 业: 电气工程及其自动化 姓 名: 李 征 指 导 教 师: 申请学位级别: 学 士
论文提交日期: 2011年 6 月10日 学位授予单位: 天津科技大学
摘 要
温度是生活中最基本的环境参数。温度环境的监测与控制,对于生物生存生长,工业生产发展都有着非同一般的意义。温度传感器的应用涉及机械制造、工业过程控制、汽车电子产品、消费电子产品和专用设备等各个领域。传统的常用温度传感器有热电偶、电阻温度监测仪RTD和NTC热敏电阻等。但信号调理,模数转换及恒温器等功能全都会增加成本。现代集成温度传感器通常包含这些功能,并以其低廉的价格迅速地占据了市场。
基于FPGA的环境测试仪采用数字式温度传感器DS1820采用数字化一线总线技术具有许多优异特性。其一,它将控制线、地址线、数据线合为一根导线,允许在同一根导线上挂接多个控制对象,形成多点一线总线测控系统。布线施工方便,成本低廉。其二,线路上传送的是数字信号,所受干扰和损耗小,性能好。
目前基于智能温度传感器DS18B20的测温设计大多是单片机程序。本课题尝试使用FPGA芯片进行设计。FPGA内部有丰富的触发器和I/O引脚,同时具有静态可重复编程和动态在系统重构的特性,极大的提高了设计的灵活性和通用性,更适合电子系统的开发。鉴于此,本课题使用硬件描述语言设计FPGA控制器来实现传感器控制。
关键词: 一线总线; 串口; 异步通讯; 握手; FPGA; DS18B20; MSCOMM
I
ABSTRACT
Temperature is one of the most essential Parameters in our life.. The monitor and control of the temperature have phenomenal importance to the growth of creatures and Industries .The temperature sensors apply to all kinds of field like mechanic manufacture, process control, automobile electrics, electronic consumer goods and other special facilities. Traditional temperature sensors include thermocouples,resistance temperature detectors, negative temperature coefficient Thermistors, etc. However,peripheries such as signal modulation,A/D conversion,Thermostat adds to the Cost. Modem integrated temperature sensors including all these functions occupy the market quickly. Digital temperature sensors DS18B20 promoted by Dallas Semiconductor Company has its distinguishing characteristics due to its the digitalized one-wire technology. First of all, it merges the control line, address line and data line into one wire, allowing muli-drop on one same wire to form a mult point temperature control system. Secondly,digital signals transmit on the bus instead of analog ones to insure small derogation and less distribution. This project aims at the design and analysis of a temperature acquisiton and control system based on the digitalized one-wire technology·
Keyword: One-wire bus; Serial Ports; Asynchronous communication; Handshake;
FPGA; DS18B20; MSCOMM
II
目 录
1 绪论 ................................................... 1 1.1 电子设计自动化(EDA) ................................. 1 1.2 硬件描述语言(HOL) ................................... 1 1.3现场可编程逻辑器件(FPGA) ............................. 1 1.4论文选题背景 ......................................... 3 1.5论文安排 ............................................. 4 2 智能温度采集控制器关键技术分析 ......................... 7 2.1温度传感器 ........................................... 7 2.2智能数字温度传感器 .................................... 9 3 系统的硬件设计 ......................................... 9 3.1体系架构框图 ........................................ 11 3.2 Control Block的设计 .................................. 12 3.3 Data Path的设计 ..................................... 15 3.4 系统开发环境 ........................................ 15 3.5 控制器设计方案 ...................................... 16
3.5.1初始方案 ............................................ 23
3.6控制器逻辑功能流程图 ................................. 23 3.7 控制器逻辑功能模块 .................................. 23
3.7.1模块的层次结构 ....................................... 23 3.7.2时钟分频模块的设计 .................................... 23 3.7.3 Data Path的设计 ...................................... 24
III
3.8界面的功能介绍....................................... 26 4 系统的软件设计 ........................................ 27 4.1 MSCOMM串口通信控件 .............................. 27 4.2 解码温度数据 ....................................... 27 4.3 程序设计关键点 ...................................... 28 5 结论及展望 ........................................... 30 5.1 结论 ................................................ 30 5.2 进一步的工作 ........................................ 30 参考文献 ................................................ 31 致谢 .................................................... 32
IV