摘要
单片机是一种集成电路芯片,采用超大规模技术把具有数据处理能力(如算术运算,逻辑运算、数据传送、中断处理)的微处理器(CPU)。随着单片机技术的飞速发展,各种单片机蜂拥而至,单片机技术已成为一个国家现代化科技水平的重要标志。
单片机可单独地完成现代工业控制所要求的智能化控制功能,这是单片机最大的特征。单片机控制系统能够取代以前利用复杂电子线路或数字电路构成的控制系统,可以软件控制来实现,并能够实现智能化。现在单片机控制范畴无所不在,例如通信产品、家用电器、智能仪器仪表、过程控制和专用控制装置等等,单片机的应用领域越来越广泛。
本毕业设计的课题是“简易数字电压表的设计”。主要考核我们对单片机技术,编程能力等方面的情况。观察独立分析、设计单片机的能力,以及实际编程技能。
本课题主要解决A/D转换、数据处理及显示控制等三个模块。控制系统采用AT89C52单片机,A/D转换采用ADC0809。
关键字介绍:单片机,AT89C52,A/D转换,ADC0809,数据处理。
Abstract
Chip Processor is a kind of chip of integrated circuit, adopt to exceed large-scale technology have data handling ability( such as arithmetic manipulation, logic is operational , data deliver and suspend handling) tiny processor ( CPU ). Along with Chip Processor technology develop fast, various Chip Processor come in great numbers, Chip Processor technology has become a important sign of the national modern level of science and technology.
Chip Processor can complete modern industrial control alone the intelligent control function that will beg, this is the feature of biggest Chip Processor. When Chip Processor control system can replace, using the control system that complex electronic line or digital circuit forms can software control come to realize, and can realize intelligence to melt. Now, Chip Processor control category is omnipresent , for instance communicate product, electric home appliances, intelligent instrument appearance, course control and the control equipment for special purpose and so on, the application field of Chip Processor is more and more extensive.
Graduate the program of design is \volmeter \technology and programming ability mainly. Observe actual programming ability as well as the ability of independent analysis and design Chip Processor.
This program solves the data handling and conversion of A/D mainly and shows the 3 modulars such as control. Control system adopts AT89C52 only flat machine, the conversion of A/D adopts ADC0809.
Keyword introduction: Chip Processor, AT89C52, A/D changes, ADC0809,Data handle.
目录
第一章 绪论 ....................................................................................................................................... 5
1.1 单片机简介 ....................................................................................................................... 5 1.2 单片机的应用领域 ........................................................................................................... 6 1.3 单片机的发展趋势 ........................................................................................................... 7 1.4 单片机应用系统的开发过程 ........................................................................................... 8
1.4.1 总体设计 ................................................................................................................... 8 1.4.2 硬件电路设计 ........................................................................................................... 9 1.4.3 软件设计 ................................................................................................................... 9
第二章 数字电压表 ......................................................................................................................... 9
2.1 数字电压表的特点 ........................................................................................................... 9 2.2 数字仪表的发展趋势 ..................................................................................................... 11 第三章 系统设计 ............................................................................................................................. 12
3.1 功能要求及设计目标 ..................................................................................................... 12 3.2 方案论证 ......................................................................................................................... 12 3.3 系统硬件电路设计 ......................................................................................................... 13 3.4 系统程序的设计 ............................................................................................................. 16
3.4.1 初始化程序 ............................................................................................................. 16 3.4.2 主程序 ..................................................................................................................... 16 3.4.3 显示子程序 ............................................................................................................. 17 3.4.4 模/数转换测量子程序 ............................................................................................ 17 3.5 性能分析 ......................................................................................................................... 18 第四章 主要硬件功能及介绍 ......................................................................................................... 19
4.1 ADC0809 ....................................................................................................................... 20
4.1.1 主要特性 ................................................................................................................. 20 4.1.2 内部结构 ................................................................................................................. 20 4.1.3 外部特性(引脚功能) ......................................................................................... 21 4.2 AT89C52 ........................................................................................................................ 22
4.2.1 主要性能 ............................................................................................................... 22 4.2.2 引脚结构 ............................................................................................................... 23 4.2.3 引脚功能说明 ....................................................................................................... 24 4.2.4 特殊功能寄存器 ................................................................................................... 27 4.2.5 存储器结构 ........................................................................................................... 28 4.2.6 定时器0和定时器1 ............................................................................................ 29 4.2.7 定时器2 ................................................................................................................ 29 4.2.8 中断 ....................................................................................................................... 30 4.2.9 晶振特性 ............................................................................................................... 31 4.2.10 空闲模式 ............................................................................................................... 32 4.2.11 掉电模式 ............................................................................................................... 33 4.2.12 程序储存器的加密 ............................................................................................... 33 4.2.13 Flash编程―并行模式 ........................................................................................ 34 4.2.14 编程方法 ............................................................................................................... 34
第五章 毕业设计总结 ................................................................................................................... 35
附录 ................................................................................................................................................... 37
附录一 简易数字电压表的单片机控制源程序 ................................................................... 37 附录二 参考文献 ................................................................................................................... 46 附录三 文献翻译 ................................................................................................................... 47
第一章 绪论
1.1 单片机简介
单片机是一种集成电路芯片,采用超大规模技术把具有数据处理能力(如算术运算,逻辑运算、数据传送、中断处理)的微处理器(CPU),随机存取数据存储器(RAM),只读程序存储器(ROM),输入输出电路(I/O口),可能还包括定时计数器,串行通信口(SCI),显示驱动电路(LCD或LED驱动电路),脉宽调制电路(PWM),模拟多路转换器及A/D转换器等电路集成到一块单块芯片上,构成一个最小然而完善的计算机系统。这些电路能在软件的控制下准确、迅速、高效地完成程序设计者事先规定的任务。
由此来看,单片机有着微处理器所不具备的功能,它可单独地完成现代工业控制所要求的智能化控制功能,这是单片机最大的特征。
然而单片机又不同于单板机,芯片在没有开发前,它只是具备功能极强的超大规模集成电路,如果赋予它特定的程序,它便是一个最小的、完整的微型计算机控制系统,它与单板机或个人电脑(PC机)有着本质的区别,单片机的应用属于芯片级应用,需要用户了解单片机芯片的结构和指令系统以及其它集成电路应用技术和系统设计所需要的理论和技术,用这样特定的芯片设计应用程序,从而使该芯片具备特定的功能。
不同的单片机有着不同的硬件特征和软件特征,即它们的技术特征均不尽相同,硬件特征取决于单片机芯片的内部结构,用户要使用某种单片机,必须了解该型产品是否满足需要的功能和应用系统所要求的特性指标。这里的技术特征包括功能特性、控制特性和电气特性等等,这些信息需要从生产厂商的技术手册中