基于单片机的风速测量的设计—软件部分.doc

约46页DOC格式手机打开展开

基于单片机的风速测量的设计—软件部分,摘 要经过50多年的单片机发展,单片机的性能价格比提高了千万倍,主要体现在速度提高了千万倍,存储器容量提高了千万倍,体积缩小了千万倍,软件性能提高了百万倍,而价格却降为万分之几。汇编语言作为用来使计算机工作的指令,与机器语言一一对应,它是用一些英语单词和字符等作为助记符来描述每一条指令,每条指令的意义一目了然,给程序的...
编号:45-197089大小:430.00K
分类: 论文>通信/电子论文

内容介绍

此文档由会员 shixin7751 发布

摘 要





经过50多年的单片机发展,单片机的性能价格比提高了千万倍,主要体现在速度提高了千万倍,存储器容量提高了千万倍,体积缩小了千万倍,软件性能提高了百万倍,而价格却降为万分之几。汇编语言作为用来使计算机工作的指令,与机器语言一一对应,它是用一些英语单词和字符等作为助记符来描述每一条指令,每条指令的意义一目了然,给程序的编写、阅读和修改带来了很大的方便。



本文介绍了51系列单片机,通过风速测量的硬件设计,画出程序流程图,编写出风速测量的软件程序,设计软件定时器,选择适当的计数器,接收三杯式风速传感器的脉冲信号,用八位51单片机将其处理成风速信号,对相应时刻的平均风速进行计算,并保存一小时的数据以备查询。



关键词:单片机;风速测量;汇编语言;软件程序



 



Abstract





After 50 years development of single chip microcontroller(SCM), its performance to price improved thousands of times, mainly in the following aspects: the speed increased thousands of times, the memory capacity improved thousands of times, meanwhile, the size became thousands of times smaller. While the performance of software increased a million times, the price dropped to only parts per ten-thousandth of the original.  As the instructions used to make computer works, assembly language is one-to-one correspondence with machine language. It is a language which uses some English words and characters as the mnemonic symbols to describe each instruction. So the meaning of each instruction is clear, and this brings a big convenience to write, read and modify the program.



This paper introduces the 51 series microcontroller, through the wind speed measurement of hardware design, drawing the program flow chart, writing out software programs of the wind speed measurement , next designing software timer, selecting the appropriate counters, receiving the signal pulse from three-cup type wind speed sensor. Then the signal is processed into the wind speed signal with eight-bit 51 microcontroller, and then calculating the average wind speed of the corresponding moment, and saving an hour of data for reference.



Keywords: SCM; wind speed measurement ; assembly language; software program



目 录





引 言 1



第一章 51系列单片机简介 3



1.1单片机与PC机的比较 3



1.2 51系列单片机 3



1.2.1 51系列单片机产生及特性 3



1.2.2 51系列单片机功能 4



1.2.3单片机系统的启动 8



第二章 系统硬件介绍 10



2.1 三杯式风速传感器 10



2.2 信号处理电路 11



2.3  AT89C51单片机 13



第三章 软件程序设计 15



3.1脉冲计数的程序设计 15



3.1.1计数器的结构及功能 15



3.1.2计数器的控制和状态寄存器 16



3.1.3计数的程序框图及子程序 17



3.2定时器的程序设计 19



3.3 十六进制数转换十进制数程序设计 20



结 论 26



参考文献 27



附 录A 29



附 录B 30



谢 辞 43