基于单片机的自动售货控制系统设计 下载本文

基于单片机的自动售货控制系统设计

摘 要

本文设计了一个基于AT89C51单片机的自动售货控制系统,文中详细的介绍了设计方案的实施背景,各种元器件的选择,系统模块的划分以及功能的实现。该系统模块划分清晰,采用按键实现人机的友好交互。以C语言为开发语言,可读、易理解性大大提高。开发环境为Keil,Proteus有机结合,keil实现代码的编写、修改、编译,Proteus则对编译好的代码在模拟器件上进行仿真。有效的提高了开发效率。系统最终实现了货物选择、投币显示、退币显示、出货显示等一系列功能。

关键词:AT89C51;自动售货机;PROTEUS

The Design of Vending Control Systems Based on SCM

Peng xin Yi

(College of Physics, Mechanical and Electrical Engineering, JishouUniversity, Jishou, Hunan 416000)

Abstract

Vending system based on AT89C51 is designed in this paper, which contains a detailed description of the implementation of the background of the design, the choice of the various components, division and function of the system module. The modular division of system is clear, using the key to achieve human-machine friendly interaction. C language for the development of language contributes readable, easy to understand greatly improved. Development Environment is Keil and Proteus. The keil is used to implement code of write, modify and compile, at the same time, proteus implements simulation. These effectively improve the development efficiency. System achieves a series of functions such as cargo selection, coin and currency recreation and shipment show. Key words: AT89C51; Vending machine; PROTEUS

I

目 录

第一章 绪 论 ......................................................................................................... 1

1.1 自动售货机的历史及发展前景 ..................................... 1 1.2 自动售货控制系统设计的意义 ..................................... 1 1.3 本文的主要设计内容 ............................................. 2 第二章 自动售货控制系统设计分析........................................................................ 3

2.1 系统总体设计分析 ............................................... 3 2.2 元器件选择 ..................................................... 4 2.3 开发工具 ....................................................... 4 第三章 自动售货控制系统硬件设计........................................................................ 5

3.1 硬件总体框图 ................................................... 5 3.2 AT89C51单片机模块 ............................................. 5

3.2.1 管脚说明 ................................................. 6 3.2.2 AT89C51单片机的主要特性 ................................. 7 3.2.3 芯片擦除 ................................................. 8 3.3 单片机驱动系统模块 ............................................. 8 3.4 系统显示模块 ................................................... 9

3.4.1 数码管显示器 ............................................. 9 3.4. 2 显示器的驱动电路 ....................................... 9 3.5 货币识别投入电路模块 .......................................... 10 3.6 货品选择按键模块 .............................................. 10 3.7 出货、退币模块 ................................................ 11 3.8 小结 .......................................................... 11 第四章 自动售货控制系统软件设计 ...................................... 12

4.1 C51语言的优缺点 .............................................. 12 4.2 Keil和Proteus开发步骤 ....................................... 12 4.3 主要模块软件设计 .............................................. 13

4.3.1 按键扫描及键值识别模块 .................................. 13 4.3.2 数码管显示电路 .......................................... 13 4.3.3 投币电路 ................................................ 14 4.4 小结 .......................................................... 14 第五章 调试与仿真 .................................................... 15

5.1 调试与仿真 .................................................... 15

II

5.2 不足与改进 .................................................... 19 总 结 ................................................................ 21 参考文献 ............................................................. 21 附 录 ................................................................ 22

III