基于单片机的煤车称重系统-软件设计 下载本文

毕业设计说明书

设计题目: 基于单片机的煤车称重系统

——软件设计

基于单片机的智能煤车称重系统——软件设计

摘要

随着社会的发展和工厂的大量建设和房地产的兴起对能源需求和依赖是越来越大,特别是对煤炭这种传统能源。随着人们的大量开采,煤炭的储量是越来越少价格是越来越高,但是需求量却在与日剧增。很显然像以往一样的采用人工称重的方式来统计矿场煤炭的开采量就显得有点跟不上时代进程且效率低下成本巨大,并且也不够精准,同时在煤炭的转卖过程中造成了大量的虚报和误报,给税务部门造成了巨大的监管困难和巨大的财税损失。这时我们就需要一种智能的实时煤车称重系统。

基于单片机的煤车称重需要借鉴一下电子称的设计原理。电子秤是将检测与转换技术、计算机技术、信息处理、数字技术等技术综合一体的现代称重仪器。电子称主要以单片机作为中心控制单元,通过称重传感器进行模数转换单元,在配以键盘、显示电路及强大软件来组成。在这基础上我们加入IC卡等在煤车称重过程中所需要的各个模块设计并很好的连接起来就能很好的实现我们在任务设计过程中所需要的功能。

在本次设计是基于AT89C52单片机设计的,AD0809转换电路,电源切换与自动充电,IC卡,显示器,传感器。

关键词:传感器,单片机,显示器,数据采集电路,IC卡

System software design based on single chip trucks

weighing

Abstract: With the growing rise of social development and plant the construction and real estate to the energy demand and dependence,

especially on the traditional energy of coal. With a large number of mining, coal reserves are less price is getting higher and higher, but the demand is on the increase with the japanese. Mining quantity obviously as usual by manual weighing approach to statistical mine coal becomes a bit behind the times

progress and inefficient cost is huge, and is not precise enough, also caused a large number of false and false positives in the resale of the process of coal, has caused enormous regulatory difficulties and huge tax loss to the tax

department. When we need the real-time vehicle intelligent weighing system. Single chip trucks weighing needs to learn from the design principle based on electronic said. Electronic scale is a weighing instrument of modern detection integrated and conversion technology, computer technology, information processing, digital technology. Electronic key to SCM as the central control unit, through the weighing sensor analog digital conversion unit, in the

accompanied by keyboard, display circuit and powerful software to form. On this basis, we join the design of each module of IC cards required in trucks weighing in the process and we need in the task design function in the process of implementation can very well connected up to very good.

In this design is based on the AT89C52 microcontroller, AD0809 conversion circuit, and automatic charging, switching power supply IC, lcd

Key words: Sensor, microcontroller, display, data acquisition circuit, IC card

目录

一、 引言 ............................................................................................................................................. 5

1.1国内外煤车称重系统现状分析及发展前景 ............................................................................... 5 1.2 单片机的简介与发展 .................................................................................................................. 6 二.总体方案设计 .................................................................................................................................. 6 2.1 方案论证 ...................................................................................................................................... 6 2.2 系统总体设计 .............................................................................................................................. 7 2.2.1 系统的工作流程 .................................................................................................................. 7 2.1.2 系统的设计方案方框图 ...................................................................................................... 8 三.系统单元元件设计 ............................................................................................................................ 8 3.1传感器 ........................................................................................................................................... 8 3.2 89C52单片机 ............................................................................................................................. 10 3.3 A/D转换电路 ............................................................................................................................. 11 3.4LED显示器 ................................................................................................................................... 12 3.5自动充电与电源切换 ................................................................................................................. 12 3.5 IC卡 ........................................................................................................................................... 13 3.6按键电路 ..................................................................................................................................... 14 四.系统软件设计 .................................................................................................................................. 14 4.1 系统主程序流程图 .................................................................................................................... 14 4.1.1 4.1.2

按键扫描 ....................................................................................................................... 15 LED显示程序 ................................................................................................................ 16

4.2 A/D转换称重程序 ..................................................................................................................... 17 4.3IC卡的子程序 ............................................................................................................................. 20 4.3.1 复位模块 ............................................................................................................................ 21 4. 3.2密码校验模块 .................................................................................................................... 22 4. 3.3命令模块 ............................................................................................................................ 23 4.4 MCS-51中断响应及处理 ........................................................................................................... 24 4.5 智能煤车称重系统的定时器/计数器 ...................................................................................... 26 4.5.1 智能煤车称重系统的定时器/计数器的工作方式及控制 .............................................. 26 4.5.1 智能煤车系统定时器/计数器的初始化 .......................................................................... 27 五.系统的软件设计的开发与调试 .................................................................................................... 28 5.1 KEIL开发软件 ............................................................................................................................. 28 5.2 系统调试 ................................................................................................................................ 29 六 总结 .................................................................................................................................................. 29 致谢 ........................................................................................................................................................ 30 参考文献 ................................................................................................................................................ 31 附录 ........................................................................................................................ 错误!未定义书签。