江苏理工学院毕业设计说明书(论文)
自动售货机系统设计
摘要:自动售货机越来越多的出现在人们的视线当中,主要因为自动售货机不受
任何场地,时间限制,而且方便快捷,操作简单。本文介绍一款以单片机AT89S52模块为核心的自动售货机系统,系统采用独立式4×4键盘模块实现货物选择、货币面值选择及找零功能,LED模块根据当前货币面值,提示出可购买的货物种类, LCD1602液晶模块将消费者在当前售货机上的购物信息显示出来。通过多次系统测试表明,该系统操作简单方便,交互性强,易于实现。
关键词:自动售货机;控制系统;AT89S52;LCD显示
The design of vending machine system
Abstract: vending machine more and more appear in the line of sight of people,mainly
because of the vending machine without any space, time constraints, and convenient, simple operation. This paper introduces a single-chip AT89S52 module as the core of the vending machine system, system uses an independent type 4 × 4 keyboard module choice of goods, currency of denomination choice and change function, the LED module according to the currency of denomination that can buy goods, LCD1602 LCD module will consumers shopping information displayed in the vending machines. That many times through the system test, this system is simple and convenient operation, strong interaction, easy to realize.
Keywords: vending machine; control system; AT89S52; LCD display
第 1 页 共 40 页
江苏理工学院毕业设计说明书(论文)
目 录
前言 ................................................................................................................................... 1
第1章 系统总体设计................................................................................................ 5
1.1 自动售货机工作流程 ........................................................................................ 5 1.2系统硬件设计 ..................................................................................................... 7 1.3系统软件设计 ..................................................................................................... 8 1.4主要功能及技术指标 ......................................................................................... 9
第2章 硬件电路设计.............................................................................................. 10
2.1 单片机控制模块 .............................................................................................. 10
2.1.1 单片机AT89S52简介 .......................................................................... 10 2.1.2单片机最小系统设计 ........................................................................... 13 2.2按键输入模块 ................................................................................................... 14
2.2.1 4×4矩阵键盘的工作原理 ............................................................... 14 2.3输出显示模块 ................................................................................................... 16
2.3.1 LCD显示模块的设计 ........................................................................... 16 2.3.2 LED显示模块的设计 ........................................................................... 17 2.4电源模块 ........................................................................................................... 17
2.4.1 LM7805简介 ......................................................................................... 17 2.4.2 5V直流稳压电源设计 ......................................................................... 18
第3章 系统软件设计.............................................................................................. 20
3.1程序的设计思想 ............................................................................................... 20 3.2主程序流程图 ................................................................................................... 20 3.3液晶写命令子程序设计 ................................................................................... 21 3.4液晶写数据子程序设计 ................................................................................... 22 3.5 显示定位子程序设计 ...................................................................................... 23
第 2 页 共 40 页
江苏理工学院毕业设计说明书(论文)
3.5.1 LCD1602光标定位方法 ....................................................................... 23 3.5.2 定位程序设计 ........................................................................................ 23 3.6定时中断服务子程序设计 ............................................................................... 24 3.7按键扫描子程序设计 ....................................................................................... 25
第4章 调试 ................................................................................................................ 27
4.1硬件的调试 ....................................................................................................... 27 4.2软件的调试 ....................................................................................................... 27 4.3系统调试 ........................................................................................................... 28
第五章 结束语 ............................................................................................................ 30 参考文献 ....................................................................................................................... 31 致谢 ................................................................................................................................. 33 附录1 电路原理图 ................................................................................................... 34 附录2 实物图 ............................................................................................................. 35 附录3 程序 ................................................................................................................. 36 附录4 元器件清单 ................................................................................................... 39
前言
自动售货机最早出现在二十世纪五、六十年代的西欧,英国是较早实行自动售货机售货的国家之一。1942年,在食品销售中首先推广了自动售货的销售方式。1950年,
第 3 页 共 40 页