1、 第 1 页 共 21 页 目录目录 目录 1 摘要 2 ABSTRACT 3 第 1 章 前言. 4 1.1 设计目的 4 1.2 设计意义 5 第 2 章 设计方案以及原理. 6 2.1 总体设计方案 6 2.2 电子台秤工作原理 6 第 3 章 硬件的方案设计. 8 3.1 基于 AT89S52 的控制电路 8 3.2 传感器 9 3.3 信号处理电路 . 10 3.4 A/D 转换器 . 10 3.5 键盘输入电路 . 11 3.6 显示电路 . 12 第 4 章 软件设计以及程序编写 13 4.1 主程序流程图 . 13 4.2 子程序设计 . 14 4.2.1 A/D 转换启动及数
2、据读取程序设计 14 4.2.2 键盘输入控制程序及显示程序设计 15 第五章 调试与仿真 17 5.1 调试 . 17 5.2 仿真 . 17 总结. 19 致谢. 20 参考文献. 21 第 2 页 共 21 页 摘要 本次课程设计是以 51 系列单片机 AT89S52 为控制核心,实现电子秤的基本控制功 能。首先通过了解电子台秤的应用以及发展前景对本次设计有一个大概的认识,再通过 制定总体设计方案以及了解其原理对本次设计有一个清晰的思路。 本次设计的硬件电路 包括 AT89S52 单片机、称重传感器、放大滤波电路、A/D 转换器、键盘输入电路和 LCD 显示电路。通过了解它们的工作原理以
3、及工作环境,来完成电子台秤的硬件部分设计; 然后通过绘制主程序流程图以及子程序的编写来完成软件部分设计;最后,对整体的调 试和系统仿真来完成本次课程设计。 关键词:AT89S52 单片机;A/D 转换器;LCD 显示器; 第 3 页 共 21 页 ABSTRACT The curriculum design is based on 51 series MCU AT89S52 as the control core, realize the basic control functions of electronic scale. : the first electronic platform s
4、cale through the application and development prospect of this design have a probably understanding, again by making overall design and understand the principle of this design has a clear train of thought. The design of hardware circuit including AT89S52 single chip microcomputer, weighing sensor, am
5、plified filter circuit, A/D converter circuit, keyboard input and LCD display circuit. By understanding their working principle and the working conditions, to complete the hardware part design of the electronic platform scale; Then through mapping the main program flow chart and the writing of the s
6、ubroutine to complete the software part of the design; Finally, the debugging and analysis of the overall design to complete the course. Key words: AT89S52 single chip microcomputer; A/D converter; LCD display; 第 4 页 共 21 页 第 1 章 前言 21世纪,电子产品变得越来越丰富,给人们带来了很多很多的方便,其中电子秤成 了人们生活中不可缺少的一部分。大大小小的市场电子秤能够完成许多工作,为人们节 省了时间,提高了工作效率。 在超市里的一台电子秤,它能很精确的称出商品的重量,还能去除皮重,更主要的 是, 它其中预存了超市里商品的单价, 当称出商品的重量后, 电子秤马上就能算出价格, 不管几种商品都能一一累加,最后列出清单,可以说非常的智能化,而且非常的精确。 近年来,电子秤已愈来愈多地参与到数据处理和